Skip to content

Fixed#2642: Convert py module references to six module#2650

Merged
RonnyPfannschmidt merged 2 commits intopytest-dev:featuresfrom
srinivasreddy:2642
Aug 4, 2017
Merged

Fixed#2642: Convert py module references to six module#2650
RonnyPfannschmidt merged 2 commits intopytest-dev:featuresfrom
srinivasreddy:2642

Conversation

@srinivasreddy
Copy link
Contributor

No description provided.

@srinivasreddy srinivasreddy changed the title Fixed#2642: Convert py module references to six module [WIP] Fixed#2642: Convert py module references to six module Aug 2, 2017
@The-Compiler
Copy link
Member

This should definitely be done on the features branch and not master.

@srinivasreddy srinivasreddy changed the base branch from master to features August 2, 2017 18:32
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a 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
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):
Copy link
Member

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

Copy link
Member

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

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
Copy link
Member

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

obj = (obj,)
# explicit naming
if isinstance(obj[0], py.builtin._basestring):
if isinstance(obj[0], six.string_types):
Copy link
Member

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


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no older versions?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0009%) to 91.962% when pulling 1547587 on srinivasreddy:2642 into 40254b6 on pytest-dev:features.

@pytest-dev pytest-dev deleted a comment from coveralls Aug 3, 2017
@pytest-dev pytest-dev deleted a comment from coveralls Aug 3, 2017
@pytest-dev pytest-dev deleted a comment from coveralls Aug 3, 2017
@pytest-dev pytest-dev deleted a comment from coveralls Aug 3, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0009%) to 91.962% when pulling 983d9e0 on srinivasreddy:2642 into 40254b6 on pytest-dev:features.

@RonnyPfannschmidt
Copy link
Member

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

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 91.987% when pulling 959672a on srinivasreddy:2642 into 40254b6 on pytest-dev:features.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 91.987% when pulling 959672a on srinivasreddy:2642 into 40254b6 on pytest-dev:features.

@srinivasreddy srinivasreddy changed the title [WIP] Fixed#2642: Convert py module references to six module Fixed#2642: Convert py module references to six module Aug 3, 2017
@nicoddemus
Copy link
Member

Thanks @srinivasreddy!

The only thing missing is a changelog entry, I suggest changelog/2642.trivial:

Refactored internal Python 2/3 compatibility code to use ``six``.

@nicoddemus
Copy link
Member

Btw, we can merge this as is and decide later if we need to vendor six or not.

@srinivasreddy
Copy link
Contributor Author

I think i am done with this PR. Whatever changes needed to remove py lib completely, can be done in another PR. 👍

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 91.987% when pulling dc563e4 on srinivasreddy:2642 into 40254b6 on pytest-dev:features.

@nicoddemus
Copy link
Member

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!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 91.987% when pulling 2e33d9b on srinivasreddy:2642 into 40254b6 on pytest-dev:features.

@RonnyPfannschmidt RonnyPfannschmidt merged commit 9e62a31 into pytest-dev:features Aug 4, 2017
@RonnyPfannschmidt
Copy link
Member

@srinivasreddy well done, good work and thank you for preserving 👍

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

Successfully merging this pull request may close these issues.

5 participants