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

Remove python 2.7 #543

Merged
merged 3 commits into from
Nov 27, 2019
Merged

Remove python 2.7 #543

merged 3 commits into from
Nov 27, 2019

Conversation

ChadBailey
Copy link
Contributor

@ChadBailey ChadBailey commented Nov 24, 2019

Removes all instances of and references Python 2.7 from the codebase as well as cookiecutter.

Fixes #405 - Python 2.7 is end of life in less than 60 days.

Also adds .vscode to .gitignore, fixes broken test in win32, and resolves all flake8 linting errors

fixed test_make_help failing on windows due to platform incompatibility,
added .vscode to gitignore
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@hugovk
Copy link
Contributor

hugovk commented Nov 24, 2019

Tip: https://github.com/asottile/pyupgrade can find and autoupgrade lots of Python syntax to Python 3+:

pip install -U pyupgrade
pyupgrade `git ls-tree -r HEAD --name-only | grep ".py$"` --py3-plus

@hugovk
Copy link
Contributor

hugovk commented Nov 24, 2019

Tip: These statements all evaluate to True and can be simplified:

tests/test_bake_project.py:if sys.version_info > (3, 0):
tests/test_bake_project.py:    if sys.version_info >= (3, 5):
tests/test_bake_project.py:    elif sys.version_info >= (3, 3):
tests/test_bake_project.py:    if sys.version_info >= (3, 5):
tests/test_bake_project.py:    elif sys.version_info >= (3, 3):

@ChadBailey
Copy link
Contributor Author

Tip: These statements all evaluate to True and can be simplified:

tests/test_bake_project.py:if sys.version_info > (3, 0):
tests/test_bake_project.py:    if sys.version_info >= (3, 5):
tests/test_bake_project.py:    elif sys.version_info >= (3, 3):
tests/test_bake_project.py:    if sys.version_info >= (3, 5):
tests/test_bake_project.py:    elif sys.version_info >= (3, 3):

Updating these tests weren't a part of my contribution, I was only refactoring to fix the linting errors. While looking through the tests, I do think they could use a refresh though... perhaps it should be done as a separate effort

@ChadBailey
Copy link
Contributor Author

ChadBailey commented Nov 24, 2019

Tip: https://github.com/asottile/pyupgrade can find and autoupgrade lots of Python syntax to Python 3+:

pip install -U pyupgrade
pyupgrade `git ls-tree -r HEAD --name-only | grep ".py$"` --py3-plus

I don't understand the context here, can you elaborate?

edit: nevermind, I think I figured it out... you're just making general recommendations for migrating from python2 to python3 right? I looked for code that was specifically designed to backport to python2 and didn't see any but I may have missed something

@hugovk
Copy link
Contributor

hugovk commented Nov 25, 2019

Hi! I thought these could be updated as they're things that can be done to modernise and simplify the codebase for #405, but I'm happy to make another PR for them.

pyupgrade automatically removes and upgrades code that is only needed for Python 2.

Copy link
Contributor

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Looks good, could also add this Trove classifier to both setups:

Programming Language :: Python :: 3 :: Only

@hugovk
Copy link
Contributor

hugovk commented Nov 25, 2019

Hi! I thought these could be updated as they're things that can be done to modernise and simplify the codebase for #405, but I'm happy to make another PR for them.

pyupgrade automatically removes and upgrades code that is only needed for Python 2.

Please see PR #545.

@ChadBailey
Copy link
Contributor Author

Hi! I thought these could be updated as they're things that can be done to modernise and simplify the codebase for #405, but I'm happy to make another PR for them.

pyupgrade automatically removes and upgrades code that is only needed for Python 2.

You're right, looking at your PR I did overlook some stuff that could have been updated. Thanks for taking the effort to do that!

Looks good, could also add this Trove classifier to both setups:

Programming Language :: Python :: 3 :: Only

Good call out, I'll update the PR with this when I return from work

@hugovk
Copy link
Contributor

hugovk commented Nov 25, 2019

You're welcome! Feel free to include or copy them in here if you wish.

@PsiACE
Copy link
Collaborator

PsiACE commented Nov 27, 2019

@ChadBailey & @hugovk
Thank you for your enthusiasm, I will merge it.

@PsiACE PsiACE merged commit 291a066 into audreyfeldroy:master Nov 27, 2019
jcreinhold pushed a commit to jcreinhold/cookiecutter-pypackage that referenced this pull request Mar 1, 2022
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.

Remove Python 2.7 support
3 participants