Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent ssl.py module with the same version number #225

Closed
CreatCodeBuild opened this issue Jul 21, 2017 · 5 comments
Closed

Inconsistent ssl.py module with the same version number #225

CreatCodeBuild opened this issue Jul 21, 2017 · 5 comments

Comments

@CreatCodeBuild
Copy link

CreatCodeBuild commented Jul 21, 2017

In version 0.7 from pip install curio, the CurioSSLContext class under ssl.py module is implemented as:

# Small wrapper class to make sure the wrap_socket() method returns the right type
    class CurioSSLContext(object):

        def __init__(self, context):
            self._context = context

        def __getattr__(self, name):
            return getattr(self._context, name)

        def wrap_socket(self, sock, *args, do_handshake_on_connect=True, **kwargs):
            sock = self._context.wrap_socket(
                sock._socket, *args, do_handshake_on_connect=False, **kwargs)
            csock = Socket(sock)
            csock.do_handshake_on_connect = do_handshake_on_connect
            return csock

        def __setattr__(self, name, value):
            if name == '_context':
                super().__setattr__(name, value)
            else:
                setattr(self._context, name, value)

But in master (not wip), the implementation was

    # Small wrapper class to make sure the wrap_socket() method returns the right type
    class CurioSSLContext(object):

        def __init__(self, context):
            self._context = context

        def __getattr__(self, name):
            return getattr(self._context, name)

        async def wrap_socket(self, sock, *args, do_handshake_on_connect=True, **kwargs):
            sock = self._context.wrap_socket(
                sock._socket, *args, do_handshake_on_connect=False, **kwargs)
            csock = Socket(sock)
            csock.do_handshake_on_connect = do_handshake_on_connect
            if do_handshake_on_connect and sock._connected:
                await csock.do_handshake()
            return csock

        def __setattr__(self, name, value):
            if name == '_context':
                super().__setattr__(name, value)
            else:
                setattr(self._context, name, value)

The API of wrap_socket is different.

My question, which version will be the future stable version? Is the version from pip install curio wip?

Do you always recommend pip install git+https://github.com/dabeaz/curio.git?

@dabeaz
Copy link
Owner

dabeaz commented Jul 21, 2017

The version number in GitHub should probably be bumped, but whatever is in GitHub master should considered to be future behavior.

@CreatCodeBuild
Copy link
Author

Can you push a new version to pypi? I have a package using Curio as a dependency. The setup.py will always install from pypi. I have not figured out how to make it install from github yet.

@dabeaz
Copy link
Owner

dabeaz commented Aug 27, 2017

Will push it today.

@perklet
Copy link

perklet commented Sep 4, 2017

@CreatCodeBuild You could install from git via pip install -e git+https://github.com/dabeaz/curio. see https://stackoverflow.com/questions/11560056/pip-freeze-does-not-show-repository-paths-for-requirements-file

@dabeaz dabeaz closed this as completed Apr 29, 2018
@CreatCodeBuild
Copy link
Author

@yifeikong I know out how to force install from GitHub in requirements.txt but still not quite in setup.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants