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

Drop support for EOL Python 3.4 (2) #6782

Merged
merged 10 commits into from
Sep 10, 2019
Merged

Drop support for EOL Python 3.4 (2) #6782

merged 10 commits into from
Sep 10, 2019

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Jul 24, 2019

Continuation of PR #6685.

As suggested in review, that PR was just for removing Python 3.4 from classifiers, CI, its deprecation warnings, and so on.

And here's a new PR for the other 3.4-related removals.

@hugovk
Copy link
Contributor Author

hugovk commented Jul 24, 2019

Please let me know if this needs a news entry or a trivial file/label.

@pradyunsg pradyunsg added skip news Does not need a NEWS file entry (eg: trivial changes) type: maintenance Related to Development and Maintenance Processes labels Jul 24, 2019
@pradyunsg
Copy link
Member

Thanks again for picking this up @hugovk! Trivial sounds good. I've gone ahead and added the equivalent label, so less work for you. :)

@cjerdonek
Copy link
Member

I think it might be better to use the PY2 and PY3 constants because cases like these are what they’re for and we use them elsewhere (and it reads more simply, etc).

@xavfernandez
Copy link
Member

I agree with @cjerdonek : you should be able to use from pip._vendor.six import PY3 in most of those places :)

@hugovk
Copy link
Contributor Author

hugovk commented Jul 25, 2019

Good idea, updated!

flake8 is failing:

tests/functional/test_install.py:14:1: F401 'pip._vendor.six.PY2' imported but unused
tests/functional/test_install.py:14:1: F401 'pip._vendor.six.PY3' imported but unused

But they're used in decorators like this:

@pytest.mark.skipif("PY2")

How should we fix it?


I'd assume Python 2.7 will be dropped before Python 4.0 is released, and these constants removed. On the off-chance it's not(!), remember to review the use of PY3 :)

@pradyunsg
Copy link
Member

They're not valid in the decorators.

You'll want leave the pytest decorator as is.

@hugovk
Copy link
Contributor Author

hugovk commented Jul 25, 2019

Thanks, I've reset and re-committed without changing the decorators.

@xavfernandez
Copy link
Member

@pradyunsg @pytest.mark.skipif("pip._vendor.six.PY3") seems to work if import pip._vendor.six is imported.

@hugovk
Copy link
Contributor Author

hugovk commented Jul 25, 2019

Should we put a # noqa: F401 on the import to prevent this flake8 warning?

diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py
index e7b6a272..e915892f 100644
--- a/tests/functional/test_install.py
+++ b/tests/functional/test_install.py
@@ -5,6 +5,7 @@ import sys
 import textwrap
 from os.path import curdir, join, pardir

+import pip._vendor.six
 import pytest

 from pip._internal import pep425tags
@@ -528,7 +529,7 @@ def test_editable_install__local_dir_no_setup_py_with_pyproject(
     assert 'A "pyproject.toml" file was found' in msg


-@pytest.mark.skipif("sys.version_info >= (3,)")
+@pytest.mark.skipif("pip._vendor.six.PY3")
 @pytest.mark.xfail
 def test_install_argparse_shadowed(script):
     # When argparse is in the stdlib, we support installing it
@@ -543,7 +544,7 @@ def test_install_argparse_shadowed(script):


 @pytest.mark.network
-@pytest.mark.skipif("sys.version_info < (3,)")
+@pytest.mark.skipif("pip._vendor.six.PY2")
 def test_upgrade_argparse_shadowed(script):
     # If argparse is installed - even if shadowed for imported - we support
     # upgrading it and properly remove the older versions files.

->

$ tox -e lint-py3
...
lint-py3 run-test: commands[0] | flake8
./tests/functional/test_install.py:10:1: F401 'pip._vendor.six' imported but unused

@pradyunsg
Copy link
Member

pradyunsg commented Jul 25, 2019

@pytest.mark.skipif("pip._vendor.six.PY3") seems to work if import pip._vendor.six is imported.

IIRC we have other uses of the current style in this PR. Personally, I'm ambivalent so anything works. :)

Copy link
Member

@chrahunt chrahunt left a comment

Choose a reason for hiding this comment

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

2 small comments, otherwise LGTM.

src/pip/_internal/utils/compat.py Outdated Show resolved Hide resolved
tests/functional/test_install.py Outdated Show resolved Hide resolved
@pradyunsg
Copy link
Member

Looks good to me. I'll merge this eagerly -- if someone spots anything else, let's do it in a follow up PR.

@pradyunsg pradyunsg merged commit ceaf514 into pypa:master Sep 10, 2019
@pradyunsg
Copy link
Member

Thanks for all your work on this @hugovk! Thanks for the reviews and inputs @xavfernandez @pfmoore @cjerdonek @chrahunt!

@hugovk hugovk deleted the rm-3.4 branch September 10, 2019 05:59
@hugovk
Copy link
Contributor Author

hugovk commented Sep 10, 2019

You're welcome and thanks for the reviews!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation skip news Does not need a NEWS file entry (eg: trivial changes) type: maintenance Related to Development and Maintenance Processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants