-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fixed#2642: Convert py module references to six module #2650
Conversation
This should definitely be done on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely done
this beings us one step closer to no longer needing pylib
_pytest/nose.py
Outdated
@@ -66,7 +66,7 @@ def is_potential_nosetest(item): | |||
def call_optional(obj, name): | |||
method = getattr(obj, name, None) | |||
isfixture = hasattr(method, "_pytestfixturefunction") | |||
if method is not None and not isfixture and py.builtin.callable(method): | |||
if method is not None and not isfixture and six.callable(method): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe the callable builtin is back on all supported python versions so should be able drop the six reference here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, from the six docs:
Note callable has returned in Python 3.2, so using six’s version is only necessary when supporting Python 3.0 or 3.1.
setup.py
Outdated
@@ -43,7 +43,7 @@ def has_environment_marker_support(): | |||
|
|||
|
|||
def main(): | |||
install_requires = ['py>=1.4.33', 'setuptools'] # pluggy is vendored in _pytest.vendored_packages | |||
install_requires = ['py>=1.4.33', 'six','setuptools'] # pluggy is vendored in _pytest.vendored_packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do wonder if we should have a minimal version there,
i suspect its necessary once we sort out _pytest.compat
@@ -613,7 +613,7 @@ def getcallargs(self, obj): | |||
if not isinstance(obj, (tuple, list)): | |||
obj = (obj,) | |||
# explicit naming | |||
if isinstance(obj[0], py.builtin._basestring): | |||
if isinstance(obj[0], six.string_types): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just noticed the missing import here, please add it
@@ -43,7 +43,7 @@ def has_environment_marker_support(): | |||
|
|||
|
|||
def main(): | |||
install_requires = ['py>=1.4.33', 'setuptools'] # pluggy is vendored in _pytest.vendored_packages | |||
install_requires = ['py>=1.4.33', 'six>=1.10.0','setuptools'] # pluggy is vendored in _pytest.vendored_packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no older versions?
well done, after the last import linting issue is resolved, we can take a look at vendoring six in order to protect ourselves against certain scenarios |
Thanks @srinivasreddy! The only thing missing is a changelog entry, I suggest
|
Btw, we can merge this as is and decide later if we need to vendor |
I think i am done with this PR. Whatever changes needed to remove py lib completely, can be done in another PR. 👍 |
Definitely, we appreciate it! Just pushed the changelog myself, I think this can be merged. Thanks again @srinivasreddy! |
@srinivasreddy well done, good work and thank you for preserving 👍 |
No description provided.