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
Python distutils is being removed #392
Comments
for package creation. In Python 3.10 and 3.11, distutils will be formally marked as deprecated. See https://www.python.org/dev/peps/pep-0632/ Albeit setuptools uses distutils internally, this will continue to work in the future, because setuptools includes its own version of distutils. See https://setuptools.pypa.io/en/latest/deprecated/index.html Tested on python 3.6+. Note: Each distribution patches heavily setuptools and distutils, the package maintainers should check correctness of the new builds. Although python PEP 518 proposes a new format to specify the build system for python packages (pyproject.toml), this is not fully implemented in python3.6 and can't be used. Fixes MythTV#392
Please review pull request #400 |
Note. This commit adds an additionally build dependency: |
For Fedora and EL, the requirement for MySQLdb > 1.3 (auto-generated by the build dependency generator) cannot be satisfied with my previous package build scripts (the python3-mysql package on the Fedora/EL variants provides mysqlclient, not mysqldb (as I recall, there was a divergence in the available connectors for python3)). Note that I believe this is a packaging build issue only, and would (likely) not impact manual compile/install, as the MythTV ansible scripts install the appropriate python library for the appropriate system (python3-mysqldb for deb based systems, python3-mysql for dnf based systems). Perhaps the install_requires could be distro specific, although that ends up being another thing to maintain for OS variants (even if PEP 508 tries to make it a little easier), and is clearly not desirable. That said, it is easy enough to exclude the auto-generated dependencies when using rpm packaging, so the patch seems to build (I have not tested functionality, but the correct files seem to get installed in the correct places) on Fedora and EL. |
It occurs to me that configure already checks for (a viable) python-MySQLdb and a python-lxml, so, perhaps, one does not need to include those in the install_requires section (which simplifies other OS library packaging due to different implementations). |
@garybuhrmaster I will either add a complete set of dependencies, i.e.: python pypi packages for |
(another) btw, since python3-setuptools is likely going to be needed going forward (no matter the details of how you deal with install_requires), committing a change now to update .github/workflows/buildmaster.yml now will (likely) let the CI pull-request checks pass going forward as you decide to update the pull request. |
@linuxdude42
At least, the item Thank you, |
btw, since this is for python3-setuptools, does this mean that the project has officially abandoned python2 support for master (and beyond)? I do not object (in fact, would recommend it), but I do not recall that being officially announced. If the project is now python3 only that may allow some elimination of some hoop jumping in certain constructs, and it can also mean removing (or replacement) for some of the python2 only scripts that were identified in #386. |
Excerpt from https://www.mythtv.org/wiki/Release_Notes_-_31 :
|
The release notes simply stated a "future version". Is v32 that version, or will there be a need for the replacement code of distutils to be able to support python2-setuptools (or whatever name the various distro uses for the python2 setuptools)? |
V32 will only support python3. |
from 'setup.cfg' because it is not handled correctly by various package managers, like Ubuntu. Only the last item is displayed. Better no information than partial partial information. Note: The package dependencies for 'libmyth-python' is handled correctly by other means within each distribution, therefore no information is lost. Refs MythTV#392
Thanks for the confirmation. |
if not given by make environment Refs MythTV#392
for package creation. In Python 3.10 and 3.11, distutils will be formally marked as deprecated. See https://www.python.org/dev/peps/pep-0632/ Albeit setuptools uses distutils internally, this will continue to work in the future, because setuptools includes its own version of distutils. See https://setuptools.pypa.io/en/latest/deprecated/index.html Tested on python 3.6+. Note: Each distribution patches heavily setuptools and distutils, the package maintainers should check correctness of the new builds. Although python PEP 518 proposes a new format to specify the build system for python packages (pyproject.toml), this is not fully implemented in python3.6 and can't be used. Fixes #392
from 'setup.cfg' because it is not handled correctly by various package managers, like Ubuntu. Only the last item is displayed. Better no information than partial partial information. Note: The package dependencies for 'libmyth-python' is handled correctly by other means within each distribution, therefore no information is lost. Refs #392
if not given by make environment Refs #392
Compiles on fedora rawhide have started throwing the following warning:
bindings/python/setup.py:4: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.core import setup
This code needs to be updated to use setuptools.
Platform: Fedora Rawhide, x86_64
MythTV version: master
Package version: if using a packaged version of MythTV, please provide repository/version
Component: Python bindings
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Happens every time.
The text was updated successfully, but these errors were encountered: