Repository navigation
Avoid fetching dependencies from TestPyPI - #2191
Conversation
Use `--no-deps` and require a wheel to avoid downloading runtime or build dependencies from TestPyPI. Replace mixed-index installation advice with separate dependency installation from PyPI, and explain the risk of unintended or malicious packages. The packaging tutorial already uses `--no-deps` and has similar guidance. Closes pypagh-1500
| The ``--index-url`` flag selects TestPyPI instead of PyPI. The ``--no-deps`` | ||
| flag prevents installing runtime dependencies, while ``--only-binary=:all:`` | ||
| requires a wheel, avoiding installation of build dependencies. If your package | ||
| has dependencies, install them separately from PyPI before running these commands. |
There was a problem hiding this comment.
Is there an existing doc about this to link to, or can an example of pip install --only-deps be added here?
There was a problem hiding this comment.
@merwok sure, if you think it's necessary. What I'd add is:
(for example, run ``pip install --only-deps .`` from your project directory).
The one hiccup is that it requires pip 26.2, which adds more noise if we explain that. I'm okay with that though; recommending outdated install methods would be worse.
WDYT?
There was a problem hiding this comment.
I think it’s useful to explain how to achieve what is recommended!
Wonder how to make this a small parenthese, not a long sentence. The pip docs is cli/pip-install but doesn’t have a version added note, so I wouldn’t want to trap people using older versions.
I like your suggested text better than a link then. Could it be:
(for example, run ``pip install --only-deps .`` from your project directory -- you'll need pip 26.2 or newer).
Use
--no-depsand require a wheel to avoid downloading runtime or build dependencies from TestPyPI. Replace mixed-index installation advice with separate dependency installation from PyPI, and explain the risk of unintended or malicious packages.The packaging tutorial already uses
--no-depsand has similar guidance.Closes gh-1500
📚 Documentation preview 📚: https://python-packaging-user-guide--2191.org.readthedocs.build/en/2191/