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

Add pre-commit pypgrade hook and update supported versions #124

Merged
merged 7 commits into from
Oct 8, 2018
Merged

Add pre-commit pypgrade hook and update supported versions #124

merged 7 commits into from
Oct 8, 2018

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Oct 2, 2018

  • Update supported versions to match supported CPython versions
    • Add 3.6 and 3.7
    • Remove 3.2 and 3.3. They are EOL (and no longer receiving security updates (or any updates) from the core Python team.
Version Release date Supported until
3.2 2011-02-20 2016-02-27
3.3 2012-09-29 2017-09-29

They're also little used.

Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

Thanks. Would you mind setting this up as a pre-commit hook? I just checked the link you shared and it has support for it https://github.com/asottile/pyupgrade#as-a-pre-commit-hook. Would be nice to have all following commits respect this same style. Please test this manually.

Side note: I think adding the python_requires line can be considered a breaking change, since even if those version should no longer be used, people can still be using them and thus they won't be able to migrate to this next version.

@hugovk
Copy link
Contributor Author

hugovk commented Oct 5, 2018

Yes, I'll add the pre-commit hook.

Shall I remove the python_requires line, would you rather keep it?

@hugovk
Copy link
Contributor Author

hugovk commented Oct 5, 2018

Here's a test after pip install pre-commit and pre-commit install:

[hugo:/private/tmp/auth0-python] update-versions ± git checkout -b testing
Switched to a new branch 'testing'
[hugo:/private/tmp/auth0-python] testing ± edit setup.py

Add something that would fail pyupgrade:

[hugo:/private/tmp/auth0-python] testing ± git diff
diff --git a/setup.py b/setup.py
index dc7ba8a..afb41f4 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ def find_version():
 setup(
     name='auth0-python',
     version=find_version(),
-    description='Auth0 Python SDK',
+    description='Auth0 Python SDK {0}'.format(123),
     author='Auth0',
     author_email='support@auth0.com',
     license='MIT',
[hugo:/private/tmp/auth0-python] testing(+0/-0) ± git commit -m "Test pre-commit"
pyupgrade................................................................Failed
hookid: pyupgrade

Files were modified by this hook. Additional output:

Rewriting setup.py
⌂65% [hugo:/private/tmp/auth0-python] testing(+1/-1) 2s 1 ± git diff
diff --git a/setup.py b/setup.py
index afb41f4..1e41f7b 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ def find_version():
 setup(
     name='auth0-python',
     version=find_version(),
-    description='Auth0 Python SDK {0}'.format(123),
+    description='Auth0 Python SDK {}'.format(123),
     author='Auth0',
     author_email='support@auth0.com',
     license='MIT',

Now try and commit again:

[hugo:/private/tmp/auth0-python] testing(+1/-1) ± git add setup.py
# On branch: testing  |  [*] => $e*
#
➤ Changes to be committed
#
#       modified:  [1] setup.py
#
[hugo:/private/tmp/auth0-python] testing(+0/-0) ± git commit -m "Test pre-commit"
pyupgrade................................................................Passed
[testing 85adb54] Test pre-commit
 1 file changed, 1 insertion(+), 1 deletion(-)

Success! 🎆

@lbalmaceda
Copy link
Contributor

@hugovk Thanks for all the details. ✨ I'd like to review the security issue introduced with this pre-commit release (see failing snyk check). Let me come back to this PR once I get a response from the team.

Regarding python_requires I think it's better to rollback those 2 lines (3.2 and 3.3) so we don't break people today, but add a note somewhere in the README regarding compatibility standing that in the near future we will remove support for those versions as they have reached EOL (+ link to the notice). Also, why have you added new lines for 2 and 3 if we only support 2.7 (for 2) and well, eventually, >3.3 ?

@hugovk
Copy link
Contributor Author

hugovk commented Oct 6, 2018

Regarding python_requires I think it's better to rollback those 2 lines (3.2 and 3.3) so we don't break people today, but add a note somewhere in the README regarding compatibility standing that in the near future we will remove support for those versions as they have reached EOL (+ link to the notice).

Something like the last two commits?


Also, why have you added new lines for 2 and 3 if we only support 2.7 (for 2) and well, eventually, >3.3 ?

Because those don't mean that Python 2.0 and 3.0 are supported, but that at least one 2.x and 3.x versions are supported.

For example, the most-downloaded package pip has these classifiers:

        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",

But I can remove them if you like.

@lbalmaceda
Copy link
Contributor

@hugovk Yup. All good. Security has approved the PR as well. Thanks for the changes 👍

@lbalmaceda lbalmaceda changed the title Update versions Add pre-commit pypgrade hook and update supported versions Oct 8, 2018
@lbalmaceda lbalmaceda added this to the v3-Next milestone Oct 8, 2018
@lbalmaceda lbalmaceda merged commit 5c643e7 into auth0:master Oct 8, 2018
@hugovk hugovk deleted the update-versions branch October 8, 2018 16:40
@lbalmaceda lbalmaceda modified the milestones: v3-Next, 3.4.0 Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants