-
-
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
[BUG] On Debian, install fails with "no such option 'install_layout'". #2956
Comments
In pypa/distutils#68, I developed the most extensive hack to support Debian's status quo. In that hack, distutils searches for |
Ummm... Sorry not good enough:
Result with error message
|
The way the example Debian |
@jaraco I had read though these issues and generally understand your concern:
First of all I am not an official Debian packager for setuptools, just on behalf of my personal cross OS packaging project, target for Ansible installation in deb/rpm:
IMHO, possible solution could be:
Personally, I vote for 4 >> 2 >> 1 >> 3 |
I considered this approach, but there are two problems with the approach:
Remember that SETUPTOOLS_USE_DISTUTILS=stdlib is a temporary escape hatch. It's there to enable end users and installers to opt out of the inevitable transition to a world without distutils in the stdlib (slated for Python 3.12). Making this change permanent in an environment does simplify orchestration of that environment, but it also has the following downsides:
Could you set that environment variable globally in the Debian environment? At least for now until Debian can adopt an approach that no longer relies on monkeypatching?
As distutils is going away, this approach is untenable. Setuptools is committed to adopting distutils, so if Debian wishes to own a patching approach, they would need to patch setuptools. They're welcome to do so if that's what they wish, but Setuptools is expecting to perform a great deal of refactoring to properly adopt distutils and remove the cruft around it, so maintaining a monkeypatch for versions of Setuptools as its evolving is going to be burdensome. That's why this project is going out of its way to provide reliable if temporary interfaces to allow for the customizations currently provided by patches.
I'm guessing by "Monkeypatch style", you mean the approach currently proposed by this project? Yes, this approach is somewhat complicated, but it's less brittle than patching as done in option 1 because it specifically patches the runtime objects and not the code, so only relies on the hook points provided by distutils. Yes, it requires coordination, but since it's meant to be temporary, I'd expect that Debian would find a way to move away from relying on these interfaces. The primary advantage of the monkeypatch approach is that it keeps the patched behavior largely disentangled from the default implementation. That is, any Python programmer can see the entirety of the patch and disable it by deleting I do see your point about maybe preferring option 1. I might prefer that too. Unfortunately, I don't think Debian is interested in owning it, so I've supplied the system mod approach as a means of unblocking users while Debian figures out how they want to proceed. If they want to keep these behaviors long-term, they should propose the behaviors as a proper feature of the project (with designs, implementations, tests, etc).
I do regret that you've been caught up in this. I would have preferred that Debian maintainers would have picked this up sooner and implemented the recommended patch, tested it, and provided forward guidance to downstream packagers like yourself. I appreciate your feedback and the effort you've taken to understand the issue. I welcome you or others to engage with the Debian project to devise a better solution. Right now, It does feel like you're 🤏 this close to having a working solution. Let me take a stab at extending the |
In pypa/distutils@69f8573 (
Is that sufficient to close this issue, at least until Debian maintainers step up with an alternative proposal? |
@jaraco Thank you very much for the
Moreover, I will try to ping Debian official python3-setuptools maintainer for this issue. They are already in 59.6.0 now (see https://packages.debian.org/sid/python3-setuptools) so soon or later they also need to face the changes ;-) |
Somewhat related (just fyi): setuptools 60 defaulting to SETUPTOOLS_USE_DISTUTILS=local combined with pypa/pip#6264 and Debian's patching of setuptools cause |
pypa/setuptools#2956 https://gist.github.com/altendky/b852296ac520b343890c55eabc90c880 ``` File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options setattr(self, dst_option, getattr(src_cmd_obj, src_option)) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__ raise AttributeError(attr) AttributeError: install_layout ```
* Avoid issue with Ubuntu 21.10+ setuptools>=06 pypa/setuptools#2956 https://gist.github.com/altendky/b852296ac520b343890c55eabc90c880 ``` File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options setattr(self, dst_option, getattr(src_cmd_obj, src_option)) File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__ raise AttributeError(attr) AttributeError: install_layout ``` * corrections * test installers in various Linux Dockers * prep docker images with basic tools * --no-confirm for pacman * debug * debug * debug * stop installing git * Revert "stop installing git" This reverts commit 4b19f16. * checkout after installing git * pacman wants --noconfirm * Revert "debug" This reverts commit e0a2aed. * Revert "debug" This reverts commit 3833da2. * Revert "debug" This reverts commit 705a3c5. * add bookworm * add install.sh -a for pacman --noconfirm automated installs * fix * fix * revert install_layout workaround * Remove =3.9* from debian python3-venv installation Already discussed this with @wallentx related to the addition in https://github.com/Chia-Network/chia-blockchain/pull/9633/files#diff-043df5bdbf6639d7a77e1d44c5226fd7371e5259a1e4df3a0dd5d64c30dca44fR85. * add fedora 33 and 34 * nicer naming * fedora not fedor * add ubuntu:bionic * also chia --help * add amazon * Amazon wants sudo * . * use git-core ppa for git in bionic * less sudo * oops
…tools The old Docker file/image based on Ubuntu 18.04 couldn't use our more "modern" setup.cfg in v6, so we upgraded setuptools to the latest version with pip. Eventually using the latest setuptools would bite us in the ass, because it started breaking deb builds: pypa/setuptools#2956 We fixed that by upgrading the distro version even further, but then started getting lots of warnings. It turned out just using the system version of setuptools with 20.04 was better.
In order to circumvent a setuptools bug its version is fixed to 58. pypa/setuptools#2956 Fix version
setuptools version
60.0.4
Python version
Python 3.9.9
OS
Ubuntu 21.10
Additional environment information
Running DEB packaging with dh-python.
Description
In Debian setuptools packaging an additional patch applied: https://sources.debian.org/src/python-setuptools/44.1.1-1/debian/patches/install-layout.diff
During 59.8.0, running
debuild -uc -us
for building setuptools WITHOUT about patch keep functioning.During 60.0.0+, no matter with / without about patch, running
debuild -uc -us
keep failing.If modify the build script as below, build now OK:
Expected behavior
For v59.8.0 WITHOUT any additional patch it is OK:
For v60.0.4 WITH
SETUPTOOLS_USE_DISTUTILS=stdlib
it is OK:How to Reproduce
For v60.0.4 WITHOUT
SETUPTOOLS_USE_DISTUTILS=stdlib
it is FAILED:Output
Code of Conduct
The text was updated successfully, but these errors were encountered: