-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Added some entry points required for bootstrapping from source. #2601
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
Conversation
@jaraco, is there anything that prevents it from being merged? |
Tests? |
And why do you need that? Why not run |
Will try that, though it likely won't work. We need
I feel like the only proper way to test it is to run the part of the mentioned Dockerfile in a clean environment. |
(closed/reopened to trigger GH events/CI stuff) |
Any updates? |
In fact no, I haven't added any tests. |
I'm closing this (without prejudice). Feel free to comment and we can re-open. Or re-submit when ready. Thanks. |
There will be no tests and likely no reopening, since it seems it is not needed by the project. If it was, it'd have been already implemented and this PR wouldn't have been existing at all. |
The question I'd like to see answered is this one:
If you add that between steps 3 and 4, does that work? |
@benoit-pierre, @jaraco, thank you. It works for GitLab CI pipeline: https://gitlab.com/KOLANICH-subgroups/docker-images/fixed_python/-/jobs/1648667066 But not for GitHub Actions one: https://github.com/KOLANICH-libs/RichConsole.py/runs/3797498484
echo "##[group] Bootstrapping packaging";
git clone --depth=50 https://github.com/pypa/setuptools.git;
git clone --depth=50 https://github.com/pypa/pip.git;
git clone --depth=50 https://github.com/pypa/wheel.git;
cd ./setuptools;
python3 ./setup.py egg_info;
cd ../wheel;
python3 -c "import re;from pathlib import Path;f=Path('setup.cfg');f.write_text(re.subn('^setup_requires.+$', '', f.read_text(), flags=re.MULTILINE)[0])";
PYTHONPATH=../setuptools:./src sudo python3 ./setup.py install;
cd ../;
cd ./setuptools;
python3 ./setup.py bdist_wheel;
PYTHONPATH=../pip/src sudo python3 -m pip install --upgrade --pre ./dist/*.whl; (I hope that I have correctly guessed what you mean under |
The traceback in that run is thus:
You'll notice that
You have a few options here. You could manually uninstall setuptools from the system site packages. Or you could try running with Regardless, I don't think adding entry points to the bootstrapping metadata would help here. I recommend to file a new issue to track the missed expectation if there still is one. |
Yeah, I have already solved this issue by sudo rm -rf /usr/lib/python3/dist-packages/setuptools;
sudo rm -rf /usr/lib/python3/dist-packages/setuptools-*.egg-info; Thanks anyway. |
Summary of changes
Excerpt from a DOCKERFILE to bootstrap python packaging
Log
First tried
bdist_wheel
for setuptools. Damn, it tries to installwheel
withpip
because it is a build dep. Trying to make use of non-installedwheel
is unsuccesful.OK, tried to build
wheel
with non-installedsetuptools
+ non-installedwheel
. No success.wheel
needs installedwheel
. OK,wheel
usessetup.cfg
, it's fairly easy to removeinstall_requires
.python3 -c import re;from pathlib import Path;f=Path('setup.cfg');f.write_text(re.subn('^setup_requires.+$', '', f.read_text(), flags=re.MULTILINE)[0])
Thenpython ./setup.py install
succeeds (how? why?).bdist_wheel
though doesn't IDK why, seems like justinstall
doesn't register entry points.OK, added an entry point for
bdist_wheel
. Damn,error: cannot copy tree 'build/scripts-3.9': not a directory
. Trying to solve by installing setuptools.trying to
python3 ./setup.py install
in setuptools dir.error: invalid command 'easy_install'
. Why??? No entry point. Created a patch with them. Then install succeeds.then we can build a wheel for setuptools and install it
then we can go to
wheel
dir, setPYTHONPATH
tosetuptools
dir to get a get the ehtry points forbdist_wheel
, build a wheel for it and install.Closes #2550
Pull Request Checklist
changelog.d/
.(See documentation for details)