-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Replace runtime dependency on setuptools with modern libraries #1578
Conversation
bb2c3ce
to
2d4cb6f
Compare
Python 3.4 is so old that it would require custom logic for this. Are we dropping that soon? If not then I'll add the hacks, just please let me know |
There are no plans to drop any of the Python versions we currently support (see setup.py or CI for the list). Reading https://setuptools.pypa.io/en/latest/pkg_resources.html
Although it is "discouraged", use of Reading the diff, this patch adds significant added installation complexity and maintenance burden. Multiple PyPI packages must be conditionally installed or not based on Python version. The Supervisor maintainers and the folks that repackage Supervisor for various distributions would have to deal with the fallout from that. It's only on 3.9 or later that no additional packages are required. It would be great if |
Users are encouraged to move off pkg_reapurces asap and not wait for stdlib versions to sunset. If the conditionality is a concern, perhaps consolidating the conditionality in a private module would help. If conditional dependencies is a concern, the backports could be required unconditionally, a state that would be preferred over using setuptools/pkg_resources. |
After this issue was reported, I checked latest setuptools and
If we make no change here, then the users, maintainers, and people who repackage Supervisor do not have to deal with any changes and also have no risk of anything breaking unexpectedly by our changes. I think there should be a clear problem being solved (e.g. deprecation warnings) to warrant changing installation requirements, putting the backports into a private module that we'd have keep updated, etc. |
Jason can confirm since he's a core maintainer of setuptools, but I think there is a plan to eventually emit deprecation warnings so it would be nice to do this before that even happens |
It's happening now! pypa/setuptools#3843 |
d069bc8
to
b8c0871
Compare
Setuptools 67.5.0 (2023-03-05) was released with a
Fixed in 0323a9a. |
Nice! I rebased |
With these dependencies added to
I installed Supervisor in an empty virtual environment that had only Python 2.7
Python 3.4
Python 3.5
Python 3.6
Python 3.7
Python 3.8, 3.9, 3.10, 3.11 Prior to the changes in this pull request, Supervisor depended only on setuptools. It required no additional dependencies on any of the above Python versions (2.7 - 3.11). We went from a project with 1 dependency, which is usually installed in every environment, to 10 in the worst case. Also concerning is the complexity of the dependency list. We went from 1 dependency (setuptools) on every version to a different list for every version of Python above. Supervisor has a lot of non-Python users and should install easily on as many systems as possible, which is why it supports a lot of legacy Python versions and had no dependencies other than setuptools. I'm concerned that adding all these dependencies to Supervisor is going to cause installation failures. It is great that on Python 3.8+ it is now possible to install Supervisor with 0 dependencies by using stdlib |
See this explanation: #1578 (comment)
This reduces the installation footprint and potential memory implications from merely importing it
On Python 3.8+ no dependencies are required