python-poetry / python-poetry/poetry
Enable offline installations: poetry install --download-only; poetry install --offline
@Secrus is already working on this.
Since Oct 13, 2024.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Motivation
After poetry has resolved the dependencies and written the lock file, it proceeds to download and install the dependencies one by one. This could be a problem for systems which are not containerized and just checkout a repo and update their dependencies to update the code. If the internet connection breaks in the middle of the process neither the old code or the new code are fully deployed.
Feature Request (simple)
A --download-then-install flag that would make poetry first download all the dependencies and then proceed to install the already downloaded dependencies could solve this use case.
The use would simply be:
poetry install --download-then-install
If any of the required dependencies could not be downloaded, poetry should not attempt to install neither remove anything and just fail. If all required dependencies had been downloaded successfully, then the installation / removal / updates are preformed using only the information in the local filesystem.
Feature Request (robust)
A combination of flags to separate both processes could also work, such as:
poetry install --download-only # Only downloads the dependencies
poetry install --offline # Installs dependencies only if all dependencies are in the local cache.
These command would be used in succession and the flags are exclusive. poetry install --offline should first look at the contents of the poetry.lock file to make sure the packages are stored in the local filesystem before performing the installation / removal / update.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.