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
Remove bootstrap script #2543
Remove bootstrap script #2543
Conversation
Here's a demo of it building from Github:
|
ec98a48
to
7181555
Compare
One thing that occurred to me after submitting the PR - this change will be backward-incompatible to build tools that are explicitly running |
As the 52.0 release already has a few breaking changes, I want to refrain from merging/releasing this change until the package has been stable for at least a week. |
Hello. Fedora maintainer here. We don't yet have pip when we build setuptools for the first time for a new Python version. And we cannot build pip without setuptools either. I can try to work around it by using the pip wheel bundled in ensurepip Python module, but I am not sure it'll work :/ |
Indeed. Perhaps what this project needs is an integration test that demonstrates how to install Setuptools from source. Even when you install using pip, there may be a problem that pip will download some other released version of setuptools to build the current version from source. Perhaps there's a better way. As a short-term mitigation, you're welcome to copy the 'bootstrap.py' script and invoke its behavior. Alternatively, if there's sufficient demand, this project can bring back that bootstrap script even if it's not used by Setuptools itself during pip-based workflows. Just confirm, and I'll make that happen quickly while working out a better long-term story to support installation from source. |
Doing that for now. Will follow #2550 for a long term solution. |
Shouldn't the problem only occur when installing from VCS sources? The PyPI source distribution should work fine (egg-info directory already present), is that not what you're using @hroncok ? |
Right. We do build from PyPI source distribution and we delete the pre-generated egg-info first thing. I suppose I've just shot myself to the leg :D |
Right now we do, but long-term it might not be the best way. Sdists have slightly different purpose than Git sources: for example, there's not much reason to include tests or documentation in them. |
Nixpkgs maintainer here. We will also keep using the bootstrap script as we do want to keep building from vcs sources. |
Many packages also filter out tests because of the default behavior of Seems odd to me the python ecosystem can no longer bootstrap from vcs sources. (pip still requires setuptools, and setuptools now requires pip) I think the removal of the bootstrap.py was a little premature until pip is able to self bootstrap. (If it ever will be able to self-bootstrap). |
Late versions of setuptools include the bootstrap metadata so can build from VCS sources naturally.
It's best to try to separate thinking of sdist and wheel into two phases, selection of sources for a source distribution, and installation from some source.
The manifest is used to find sources, so useful only to the sdist production, so doesn't affect what's installed. There are other ways to affect finding sources (setuptools_scm for example).
Pip doesn't require setuptools. It does vendor pkg_resources, but it runs fine without setuptools. I've been running with Setuptools uninstalled in my environments and it works well. When installing packages that implicitly depend on setuptools, I have to pass Furthermore, setuptools does not depend on pip for the primary, long-term-supported use-cases. It does fall back to pip for
Pip self bootstraps now through
|
Just a quick JFYI we've failed attempting to do this in the Fedora package and I still need investigation (or try harder). |
Indeed, to build a setuptools sdist python setup.py egg_info
python setup.py sdist --formats=gztar After that, to build an env with pip, setuptools and wheel # Give folders a known name
mv pip* pip
mv setuptools* setuptools
mv wheel* wheel
# Set up PYTHONPATH. The above folders need to be on PYTHONPATH
# $out is where we are installing to and takes precedence
export PYTHONPATH="$out/${python.sitePackages}:$(pwd)/pip/src:$(pwd)/setuptools:$(pwd)/setuptools/pkg_resources:$(pwd)/wheel:$PYTHONPATH"
echo "Building setuptools wheel..."
pushd setuptools
rm pyproject.toml
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd
echo "Building wheel wheel..."
pushd wheel
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd
echo "Building pip wheel..."
pushd pip
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd |
Summary of changes
Remove bootstrap script and tox hacks and just let pip and PEP 517 do the work. This approach did not work on Python 2.7, but appears to work for the currently-supported Pythons.
Closes #1527.
Pull Request Checklist
changelog.d/
.(See documentation for details)