Output installed Python packages in requirements format, including also hashes of Python packages.
Project description
Output installed Python packages in requirements format, including also hashes of Python packages
Installation
The tool can be installed from GitHub:
pip install git+https://github.com/fridex/pip-preserve.git
You can also consume the published package on PyPI (recommended):
pip install pip-preserve
Usage
After the installation process is successfully done, pip-preserve CLI is available:
pip-preserve --help
By default, the tool uses the current environment to find installed packages and reconstruct a requirements.txt file:
pip-preserve
#
# This file is autogenerated by pip-preserve version 0.0.0 with Python 3.9.9.
#
packaging==23.0 \
--hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2
If you wish to obtain direct URLs of packages installed, you can pass --direct-url flag:
#
# This file is autogenerated by pip-preserve version 0.0.0 with Python 3.9.9.
#
https://pypi-hypernode.com/packages/ed/35/a31aed2993e398f6b09a790a181a7927eb14610ee8bbf02dc14d31677f1c/packaging-23.0-py3-none-any.whl \
--hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2
If the tool cannot determine from where a package was installed, it will fail. This error can be ignored by supplying --ignore-errors flag. Any errors are turned into warnings that can be reviewed once the tool prints results.
To explicitly point to a site-packages directory, use the --site-packages option.
To get more information about this tool, issue --help.
FAQ
Q: The tool fails or I’m getting warnings similar to the one below and my output is missing some packages:
No provenance_url.json or direct_url.json found
A: You most probably don’t have pip with PEP-710 support. Please install pip with PEP-710 support, for example using this patch).
License
See the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pip-preserve-0.0.1.tar.gz
.
File metadata
- Download URL: pip-preserve-0.0.1.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17c7c80fd6778508c9735284b0dcdc2e7b08c24fe797d09ead041fdb4ca08c8 |
|
MD5 | bf640e9458dc219887be6d7766d8461e |
|
BLAKE2b-256 | 4011dd6f1cd14f6ca168d4ccd83738f80ee00b5a0dab5a75b40fabc72b54650a |
File details
Details for the file pip_preserve-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pip_preserve-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6796cf1e2f5cc48d739321426a466ac0444180c3525cbac453e6c0c2d837eda4 |
|
MD5 | f308e555096348e914f44d79c6ee5047 |
|
BLAKE2b-256 | 8af5fbc38b70a6e85a6b63d323bbd27e36cc1f7d9270cd948fc57ee950fd5700 |