Conversation
Summary is that distutils has been deprecated for a while and will be removed in 3.12. setuptools is its replacement. However its use as an installation mechanism, e.g. *calling* setup.py install with CLI arguments is also being deprecated - with no good alternative (yet) being available. Since the whole world still depends on it I don't expect the latter to go away any time soon though, but it does seem to no longer care about fixing things for that frontend which is what now cause prefix arguments to not work as expected (installing things in /usr/local/ whilst specifying --prefix=/usr), which breaks the building of Debian packages. What Debian/Ubuntu seem to have done is patch setuptools to make it keep on behaving as they want, but only if you provide --install-layout=deb. So now providing that argument for all calls of "python setup.py install" in the Debian build. This would have also worked in combination with distutils, but taking this opportunity to upgrade to setuptools (since we'll have to soon anyway). These are changes by @Patol75, taken from FluidityProject/fluidity#351.
To avoid having to deal with the setup.py install vagueries when installing python for Debian packaging, let pybuild take care of the building and installing of python. Rewrite debian/rules to make use of debhelper for as much as possible and minimize hackery. Also remove Debian-packaging-specific hacks in Makefile.in The recipe we are now following is to install everything in debian/tmp (instead of straight into the debian/<package>/ directories), and divide the resulting files up over the packages using debian/<package.install> files. Try to clean up some Lintin errors and warnings in the process.
5df64df to
50b759a
Compare
Add python3-pip as build dependency
77fa851 to
7aab038
Compare
a879b5d to
b535227
Compare
Contributor
Author
|
Closing now because apparently doing things the proper way is broken due to pypa/pip#10978 i.e. prefix installs are broken. It appears only using distutils (instead of setuptools) and "python setup.py install" (instead of pip install) still works - although these are both now deprecated - any other combination of these two fails. This leaves only the rewritten debian/rules and extended testing which I'll PR separately |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is firstly to fix the failure to build Debian packages with newer versions of python. I believe this is to do with some of the vagueries of "python setup.py install" not really being recommended/supported anymore. Instead we now pybuild to do the installing during the Debian package build which uses Debian's patched version of distutils/setuptools to circumvent this.
In the process upgrade the setup.py scripts to use setuptools instead of distutils (which is even more deprecated) using the changes in FluidityProject/fluidity#351 by @Patol75
In addition rewrite and simplify debian/rules to make use of debhelper for as much as possible