-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] distutils is deprecated and slated for removal in python3.12 #60476
Comments
Started to dig into this, and it's somewhat promising! Not great or perfect, but promising. I'm playing around on my fork https://github.com/waynew/salt/tree/distutils-removal to see what does what. I built a setup.cfg based off some limited information from the This is obviously a very limited subset of functionality, but the fact that nothing broke or went horribly wrong is a good sign. One thing that is definitely going to need changes, though, is the bootstrap script, since right now it runs In theory we could just do the setup.py version (or perhaps also allow setup.py) but I think taking this opportunity to slim some things down would be a good idea 🤔 Of course, the tiamat builds might make the bootstrap script less of an issue. I'm also not familiar with the rest of the packaging, like rpms and debs. 🤔 |
This also affects a few modules as well...
...and then
|
We're starting to see this with every salt command:
|
This is in Master |
Workaround for saltstack/salt#60476 It prints warning to stdout(?!). The issue is fixed upstream already, but the fix isn't packaged yet. At this time, it affects Fedora 37 only. Fixes QubesOS/qubes-issues#7834
Workaround for saltstack/salt#60476 It prints warning to stdout(?!). The issue is fixed upstream already, but the fix isn't packaged yet. At this time, it affects Fedora 37 only. Fixes QubesOS/qubes-issues#7834
Workaround for saltstack/salt#60476 It prints warning to stdout(?!). The issue is fixed upstream already, but the fix isn't packaged yet. At this time, it affects Fedora 37 only. Fixes QubesOS/qubes-issues#7834 (cherry picked from commit d17b669)
Running into issue on replacing distutils.sysconfig.get_python_lib() on Debian / Ubuntu since this returns the path
and is discussed here in Python bugs https://bugs.python.org/issue41282#msg393021 proposed replacement is as follows:
This could affect previously installed packages, but we are using onedir moving forward, however those with forks of Salt Project will be affect, for example, the Debian fork of Salt. |
run into issue with generating versions for Salt, setup.py wrote out salt/_versions.py when generating sdist, see write_salt_version etc.
and untaring a python3 setup.py sdist generated tar ball
so need to reconcil the setuptools-scm 3005.2 ??? and why it is 3005.2 vs the current 3005.1 Need to ensure that no matter the method setup.py or setuptools-scm, the same version is reported for Salt. |
Agreed work for now keeping setup.py since work-flows and usage patterns (was always the plan) but need to resolve how version is handled, especially since want to be able to release a nightly build that has passed all tests etc. as v300x.y.z without having to rebuild anything, which currently can not do with distutils or setuptools approaches. |
Problem with 3006.0 is due to changes in salt/utils/version.py, changes to StrictVersion or LooseVersion cause the problem to occur, noting that a pip3 list | grep salt reuturns 3006.0, but salt-call --local test.version returns the 3005.1+1545.g776c30659f, with distutils.version but those agree with 3005.1+1545.g776c30659f. The PyPI looseversion is not a direct compatible direct replacement for distutils.version.LooseVersion as it stated. |
Ran into the cause of the issue of version 3006.0 appearing and is due to an ImportError in salt/version.py. With Python recommending using packaging.version instead of distutils.version, and thus import from packaging, results in an ImportError with pip install
This implies needing to add build-system to the pyproject.toml file, such that pip will install the needed packages, packaging and looseversion before attempting to install the rest of Salt (note the problem occurs during pip's 'Getting requirements to build wheel: started', so there is not a chance to fuly resolve all the requirements for Salt.
However this result in the following ModuleLoadError
This problem occurs even if you remove any changes in salt/utils/version.py, that is back to using distutils.version. The presence of the build-system commands in pyproject.toml causes the issue. This may be due to pyproject.toml in its current state is not fully fleshed out for use, for example: nothing defining project salt. Solution for now is to utilize setuptools._distutils.version for now, and allow time to fully research pyproject.toml issues and fully flesh it out for use with Salt. Note Setuptools links still shows pyproject.toml usage as BETA as of 2022-12-15 , url https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#beta
|
Description
from setup.py on py3.10
We need to update our setup.py to not use distutils by the time python3.12 is out.
The text was updated successfully, but these errors were encountered: