reqver
A command-line tool to add version information to requirements.txt files.
Usage
reqver <params> files
For more information, please refer to the documentation.
reqver
Latest version: 0.1.8
A command-line tool to add version information to requirements.txt files.
Installation
pip install reqver
Usage
reqver [OPTIONS] [FILES]...
If no files are given, reqver looks for requirements.txt in the current directory. If not found, it searches parent directories. If still not found, it displays an error message.
Options:
--force: Force update of all package versions, even if they already have version information.--no-backups: Do not create backup files when updating requirements files.
Examples:
-
Process requirements.txt in the current directory:
reqver -
Process a specific requirements file:
reqver path/to/requirements.txt -
Process multiple requirements files:
reqver req1.txt req2.txt -
Force update all versions:
reqver --force requirements.txt -
Update without creating backups:
reqver --no-backups requirements.txt
Behavior
For each specified file (or the found requirements.txt):
- Treats it as a requirements file (if it is a text file).
- For each requirement in the file:
- If version info is present: leaves it as is, unless the
--forceoption is set. - If no version info is present: gets the current version with pip.
- If version info is present: leaves it as is, unless the
- Creates a backup of the old requirements file (unless
--no-backupsis used). - Writes the new requirements file with updated version information.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Running Tests
To run the tests for this project, follow these steps:
-
Ensure you have the necessary dependencies installed:
pip install -r requirements.txt -
Navigate to the root directory of the project.
-
Run the tests using Python's unittest module:
python -m unittest discover tests
This will discover and run all the tests in the tests directory.
Uploading to PyPI
To upload a new version of this package to PyPI:
- Update the version number in
setup.py. - Build the package:
python setup.py sdist - Upload to TestPyPI (optional):
twine upload --repository testpypi dist/* - Upload to PyPI:
twine upload dist/*
Make sure you have the latest versions of setuptools, wheel, and twine installed before building and uploading:
pip install --upgrade setuptools wheel twine
Release files for reqver 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| reqver-0.1.8.tar.gz | 6.0 kB | Details |
Release files / reqver-0.1.8.tar.gz
| Download URL | reqver-0.1.8.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
925010be93b7303c17e953d47cfb0039d7b81ce56f4430ba62362d7b22b8b463
|
|
BLAKE2b-256 checksum How to use checksums |
429a618e70b051ffeed3bfd798ccbdf4fa5f2312db8269461c1450894a0af5e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.6
|