-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Drop support for Python 2.7 #1458
Comments
Hello @jaraco! Apologies if this is documented somewhere else. Are there any additional plans for dropping Python 2.7 support? |
In the brief discussions I've had with others, I get the sense there are too many environments that would break if setuptools were to drop Python 2 support. In many ways, setuptools is at the base of the dependency tree so will have to be the last package to drop support. |
Pip is in a similar boat, see pypa/pip#6148 and for packaging in general see https://discuss.python.org/t/packaging-and-python-2/662. |
I'd like to revive consideration for this issue, not because it's Jan 2020 as much as that I spent several hours yesterday addressing Python 2 support in this codebase. Let's say we were to summarily drop support for Python 2.7 today - what impact would that have? Projects using pip 9 or later to install setuptools would not be affected (they'd continue to get compatible, if frozen, versions). Only projects using That seems perfectly reasonable to me. |
@jaraco I tend to agree in some ways, but I think @dstufft's comment from the discourse thread is on point (as usual):
As much as I would love to say that we should drop it today, the natural consequence of us dropping Python 2 support is that projects still supporting Python 2 won't be able to use new features we support. What that means is that all the projects right now who aren't adding I see |
One other thing to note: when we do go for the Python 2 drop, we should probably advertise it with enough advance notice that it can be a meaningful driver of people's behavior. If we make big enough fanfare about it and give people 6 or 9 months' notice, we may be able to induce marginal holdouts to drop Python 2 entirely. If we do it suddenly without prior announcement, I think people will scramble to get workarounds in place and then find that the workarounds are "good enough". |
Hello we are using Python 2.7 and seeing a scary message every time we invoke
Warning message:
|
O_O
The short answer is yes, but it's possibly more complicated. I see you have
I'm not sure when Setuptools will start breaking on Python 2.7, but it will be at least a few months, and no sooner than Apr 20. If you are electing to just ignore the warning, you can suppress it with an environment variable Does that help? |
…eamble to make referencing the warning more reliable. Ref #1458.
This is helpful, thank you! |
) Setuptools 45.x is the last to support Python 2. It has an incredibly noisy stderr message to make sure users are aware of this: ``` /private/var/folders/sx/pdpbqz4x5cscn9hhfpbsbqvm0000gn/T/process-executionUnBXvi/pex_root/install/setuptools-45.2.0-py2-none-any.whl.91f9e7e571716e18411266133f3db5a0212dfa92/setuptools-45.2.0-py2-none-any.whl/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2 ************************************************************ You are running Setuptools on Python 2, which is no longer supported and >>> SETUPTOOLS WILL STOP WORKING <<< in a subsequent release (no sooner than 2020-04-20). Please ensure you are installing Setuptools using pip 9.x or later or pin to `setuptools<45` in your environment. If you have done those things and are still encountering this message, please comment in pypa/setuptools#1458 about the steps that led to this unsupported combination. ************************************************************ sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60) ``` By tweaking our default versions, we can make sure our users don't get this noise when running `./pants fmt2` and `./pants lint2`.
Hello , we are using python 2.7 , pip version 20.0.2 and setuptool version is 45.1.0 but getting the below warning message . /usr/lib/python2.7/site-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2 You are running Setuptools on Python 2, which is no longer
pip -V As you can see the pip version is greater than 9.x but still i am getting the warning. do we need to downgrade SETUPTOOL < 45. |
@soumya-devops Maybe. Here's the order of preference for how you should approach the issue:
If this advice doesn't solve your issue, please file a new bug describing what you've tried and how you end up with an unexpected (incompatible) version of setuptools. Please try to include any details will allow someone else to replicate the issue, such as the commands you ran and the output they gave. |
I know nothing about python, but I have to use it like a chimpanzee right now. Thanks. P.P.S.: Solution for now:
|
Essentially, ensure you're using
I wouldn't recommend suppressing warnings, as eventually setuptools will drop code compatibility for Python 2.7 and the error will become a crash. If this isn't enough to help, please open a new issue describing the steps you use to create your environment where you're getting the incompatible version of setuptools. |
If you're getting python2-setuptools via your distribution package manager channel, you should probably ask the Slackware developers to roll back their build recipe. That is what we (Arch Linux) did for our distribution setuptools package. We have pinned it to 44.0.0 |
I am using app_1 | ************************************************************ |
Hallo, I was trying to run a shadow hand simulation. I am running
|
Hi @MarenRobers . Sorry to hear you're having trouble. In order to solicit better details about these issues, I've created https://bit.ly/setuptools-py2-warning and future versions of setuptools will direct users there to file a report about their Python 2 compatibility issues. Please follow that link (or simply complete the relevant template) to create a separate issue relating to your environment. I'm going to lock this thread so that others get this same guidance. |
It's possible we already have a ticket for this, but #1457 revived the idea. Here are my thoughts:
I'm interested in dropping support for new releases on Python 2.7. I can imagine maintaining support for Python 2.7 in a bugfix-only branch. My main worry would be breaking the expectation that the latest version of setuptools is generally viable in all supported versions. But there are features now that would mitigate that issue -- the python_version declaration and PEP 518 support in pip, I'm thinking systems admins and app developers would still be able to install the "latest" version of setuptools, even in Python 2.7, but they would only get the maintenance versions. Presumably the same thing happened for Python 2.6. I'd really like to drop support for Python 2.7 earlier than later if possible.
The text was updated successfully, but these errors were encountered: