-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Removed Python2 support #7031
Removed Python2 support #7031
Conversation
build failure is expected as the Jenkinsfile being built is the one from target branch, not the one modified by PR. |
Yes please :) |
I was expecting so, so my comment :) I had such issue myself in the past and started getting crazy. |
Python 2 will be EOL in a few weeks, and this would only impact people who consider docker-compose as a library to build third party products, which we know exists but never aknowledge we want to support. We should be free to refactor our codebase and drop python 2 support as long as the CLI tool is available to our end-user base. |
see #7034 |
@venthur could you please reconfigure your PR to target |
dca8bef
to
9af8aec
Compare
@ndeloof Did I do something wrong? |
nope, I just missed the reference to python 2.7 by |
|
I don't know what's going on either, I double-checked the diff, I did however remove EDIT: also you can see requests was actually installed |
please give me some time to get py2 branch fixed ;) |
71e81fb
to
ec41f41
Compare
I was able to fix the py2 branch (https://ci.docker.com/public/blue/organizations/jenkins/compose/detail/py2/3/pipeline/) and rebased your PR on top (I had to force push, so if you need to make some changes, be carreful to re-create your local branch from https://github.com/venthur/compose/tree/remove_python2) |
Nice! With respect to the merge, I also tend to agree that it should not matter if we merge it now, as long as the CLI has a major version bump. If people consume directly from On the other hand, if the patch itself looks good to you and is likely to be merged at some point, I don't have a problem maintaining it for a while. |
Python2 reached its EOL, can we merge now? |
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.
Please merge #6623 first
So, it's mid-February. Any chance we can drop Py2 support by merging? :) |
@venthur Sorry for the late reply, but we got to the conclusion (based on pypi downloads data) that it would be more prudent to sync that with the next Ubuntu release. That new release will eliminate Python2. |
I was working on a branch before I noticed you had already done most of the same things I did @venthur . Is it ok if I add to it? In my branch I also changed dictionary comprehensions and other details that are cleaner in python3. (Like format strings) |
You might want to run and add pyupgrade as a pre-commit hook
…On Tue, 10 Mar 2020, 14:09 alexrecuenco, ***@***.***> wrote:
I was working on a branch before I noticed you had already done most of
the same things I did @venthur <https://github.com/venthur> . Is it ok if
I add to it? In my branch I also changed dictionary comprehensions and
other details that are cleaner in python3. (Like format strings)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7031?email_source=notifications&email_token=AADFATG4YETC6QPGJUEEOV3RGZC2ZA5CNFSM4JPDUY22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOLR5CA#issuecomment-597106312>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADFATDNWWMMNI2GRF2Q3FDRGZC2ZANCNFSM4JPDUY2Q>
.
|
I noticed we are on this branch far behind master, can we rebase? After all, this change affects almost all files, it should probably be done close to the tip. We can rebase from Is that ok? |
---- Downgrade gitpython to 2.1.15 and idna to 2.8 Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com> Removed Python2 support Closes: docker#6890 Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com> Removed six Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
---- Downgrade gitpython to 2.1.15 and idna to 2.8 Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com> Removed Python2 support Closes: docker#6890 Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com> Removed six Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com> Removed now useless check for version_info >= 2.7 Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com> Removed now unused get_output_stream method Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com> Import unittest.mock directly. We don't need to support Python2 anymore. Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
---- Downgrade gitpython to 2.1.15 and idna to 2.8 Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com> Removed Python2 support Closes: docker#6890 - Removed six - Removed now useless check for version_info >= 2.7 - Removed now unused get_output_stream method - Import unittest.mock directly. How we removed six from docker-compose We expect this to happen in a couple steps, 1. Remove six entirely, and remove python2.7 from requirements, setup, etc. 2. cleanup code that is left (All the conditionals that are now always True or False) 3. Remove all unnecessary `__future__` commands, by modifying the pre-commit-hook of python sourts to be `--py3-plus` After removing all occurrances, we made sure `six` wasn't used anymore running a search for ```txt six\.\w+\(([^()]+)\) ``` - We replaced all types for their corresponding python3 types. Note how six returns a tuple for the isinstance (since in python2 there are more than one type, but that isn't necessary in python3, so we removed the tuple and instead used the class directly) We then searched for all instances where code could be pruned. (i.e., if/else clauses that now where always `True` or `False`) After that, - Removed inheritinng from `object` super class, it isn't necessary in python3 - `# coding ... utf-8` statements are not needed - `super(ClassName, self)` can now be replaced with `super()`
---- Removed Python2 support Closes: docker#6890 - Removed six - Removed now useless check for version_info >= 2.7 - Removed now unused get_output_stream method - Import unittest.mock directly. How we removed six from docker-compose We expect this to happen in a couple steps, 1. Remove six entirely, and remove python2.7 from requirements, setup, etc. 2. cleanup code that is left (All the conditionals that are now always True or False) 3. Remove all unnecessary `__future__` commands, by modifying the pre-commit-hook of python sourts to be `--py3-plus` After removing all occurrances, we made sure `six` wasn't used anymore running a search for ```txt six\.\w+\(([^()]+)\) ``` - We replaced all types for their corresponding python3 types. Note how six returns a tuple for the isinstance (since in python2 there are more than one type, but that isn't necessary in python3, so we removed the tuple and instead used the class directly) We then searched for all instances where code could be pruned. (i.e., if/else clauses that now where always `True` or `False`) After that, - Removed inheritinng from `object` super class, it isn't necessary in python3 - `# coding ... utf-8` statements are not needed - `super(ClassName, self)` can now be replaced with `super()` Signed-off-by: Alejandro G. Recuenco <alejandrogonzalezrecuenco@gmail.com>
---- Removed Python2 support Closes: docker#6890 - Removed six - Removed now useless check for version_info >= 2.7 - Removed now unused get_output_stream method - Import unittest.mock directly. How we removed six from docker-compose We expect this to happen in a couple steps, 1. Remove six entirely, and remove python2.7 from requirements, setup, etc. 2. cleanup code that is left (All the conditionals that are now always True or False) 3. Remove all unnecessary `__future__` commands, by modifying the pre-commit-hook of python sourts to be `--py3-plus` After removing all occurrances, we made sure `six` wasn't used anymore running a search for ```txt six\.\w+\(([^()]+)\) ``` - We replaced all types for their corresponding python3 types. Note how six returns a tuple for the isinstance (since in python2 there are more than one type, but that isn't necessary in python3, so we removed the tuple and instead used the class directly) We then searched for all instances where code could be pruned. (i.e., if/else clauses that now where always `True` or `False`) After that, - Removed inheritinng from `object` super class, it isn't necessary in python3 - `# coding ... utf-8` statements are not needed - `super(ClassName, self)` can now be replaced with `super()` Signed-off-by: alexrecuenco <alejandrogonzalezrecuenco@gmail.com>
---- Removed Python2 support Closes: docker#6890 - Removed six - Removed now useless check for version_info >= 2.7 - Removed now unused get_output_stream method - Import unittest.mock directly. Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
@venthur Can you rebase this PR pls? We are finally ready to merge |
Closes: docker#6890 Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
We don't need to support Python2 anymore. Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
Done, re-based onto current master. |
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.
LGTM
Thank you @venthur ! |
This removed |
This PR removes Python2 support and removes all traces of
six
.Closes: #6890
Signed-off-by: Bastian Venthur bastian.venthur@flixbus.com
Resolves #6890
Resolves #7503