When getting myself acquainted with PEP 517, build isolation and pyproject.toml, I discovered an issue when testing package deployment on TestPyPI, as described in this tutorial.
In short, installing a 517-style package via TestPyPI fails with an error stating that “setuptools” is not available: ERROR: No matching distribution found for setuptools
The reason for this error, so I was told, is that TestPyPI is not able to provide the dependencies for the build system (in my case setuptools
and wheel
), because TestPyPI is not maintained as complete package repository. (Details: pypa/pip#9242 and setuptools/2521)
@uranusjr suggested to work around this problem by using:
pip wheel setuptools wheel -w ./wheels
pip install --find-links ./wheels \
--index-url https://test.pypi.org/simple \
my-fancy-package
rm -r ./wheels
I don’t know how common it is to use TestPyPI before rolling out new packages, but 517-style packages are currently not supported well. Updating the above mentioned tutorial about this is a minimal fix, but this issue might deserve some broader discussion.
What are your thoughts about this?
# pyproject.toml
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
# Upload
twine upload --repository testpypi dist/*
# Command causing the above problem
pip install --index-url https://test.pypi.org/simple/ \
--no-deps my-fancy-package