# 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
[![PyPI version](https://badge.fury.io/py/reqver.svg)](https://badge.fury.io/py/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:
1. Process requirements.txt in the current directory:
```
reqver
```
2. Process a specific requirements file:
```
reqver path/to/requirements.txt
```
3. Process multiple requirements files:
```
reqver req1.txt req2.txt
```
4. Force update all versions:
```
reqver --force requirements.txt
```
5. Update without creating backups:
```
reqver --no-backups requirements.txt
```
## Behavior
For each specified file (or the found requirements.txt):
1. Treats it as a requirements file (if it is a text file).
2. For each requirement in the file:
- If version info is present: leaves it as is, unless the `--force` option is set.
- If no version info is present: gets the current version with pip.
3. Creates a backup of the old requirements file (unless `--no-backups` is used).
4. 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](LICENSE) file for details.
## Running Tests
To run the tests for this project, follow these steps:
1. Ensure you have the necessary dependencies installed:
```
pip install -r requirements.txt
```
2. Navigate to the root directory of the project.
3. 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:
1. Update the version number in `setup.py`.
2. Build the package:
```
python setup.py sdist
```
3. Upload to TestPyPI (optional):
```
twine upload --repository testpypi dist/*
```
4. 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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Ralf12358/reqver",
"name": "reqver",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "requirements version pip",
"author": "Ralf Schneider",
"author_email": "ralf.schneider@example.com",
"download_url": "https://files.pythonhosted.org/packages/42/9a/618e70b051ffeed3bfd798ccbdf4fa5f2312db8269461c1450894a0af5e2/reqver-0.1.8.tar.gz",
"platform": null,
"description": "# reqver\r\n\r\nA command-line tool to add version information to requirements.txt files.\r\n\r\n## Usage\r\n\r\n```\r\nreqver <params> files\r\n```\r\n\r\nFor more information, please refer to the documentation.\r\n# reqver\r\n\r\n[![PyPI version](https://badge.fury.io/py/reqver.svg)](https://badge.fury.io/py/reqver)\r\n\r\n**Latest version: 0.1.8**\r\n\r\nA command-line tool to add version information to requirements.txt files.\r\n\r\n## Installation\r\n\r\n```\r\npip install reqver\r\n```\r\n\r\n## Usage\r\n\r\n```\r\nreqver [OPTIONS] [FILES]...\r\n```\r\n\r\nIf 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.\r\n\r\n### Options:\r\n\r\n- `--force`: Force update of all package versions, even if they already have version information.\r\n- `--no-backups`: Do not create backup files when updating requirements files.\r\n\r\n### Examples:\r\n\r\n1. Process requirements.txt in the current directory:\r\n ```\r\n reqver\r\n ```\r\n\r\n2. Process a specific requirements file:\r\n ```\r\n reqver path/to/requirements.txt\r\n ```\r\n\r\n3. Process multiple requirements files:\r\n ```\r\n reqver req1.txt req2.txt\r\n ```\r\n\r\n4. Force update all versions:\r\n ```\r\n reqver --force requirements.txt\r\n ```\r\n\r\n5. Update without creating backups:\r\n ```\r\n reqver --no-backups requirements.txt\r\n ```\r\n\r\n## Behavior\r\n\r\nFor each specified file (or the found requirements.txt):\r\n\r\n1. Treats it as a requirements file (if it is a text file).\r\n2. For each requirement in the file:\r\n - If version info is present: leaves it as is, unless the `--force` option is set.\r\n - If no version info is present: gets the current version with pip.\r\n3. Creates a backup of the old requirements file (unless `--no-backups` is used).\r\n4. Writes the new requirements file with updated version information.\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## Running Tests\r\n\r\nTo run the tests for this project, follow these steps:\r\n\r\n1. Ensure you have the necessary dependencies installed:\r\n ```\r\n pip install -r requirements.txt\r\n ```\r\n\r\n2. Navigate to the root directory of the project.\r\n\r\n3. Run the tests using Python's unittest module:\r\n ```\r\n python -m unittest discover tests\r\n ```\r\n\r\nThis will discover and run all the tests in the `tests` directory.\r\n\r\n## Uploading to PyPI\r\n\r\nTo upload a new version of this package to PyPI:\r\n\r\n1. Update the version number in `setup.py`.\r\n2. Build the package:\r\n ```\r\n python setup.py sdist\r\n ```\r\n3. Upload to TestPyPI (optional):\r\n ```\r\n twine upload --repository testpypi dist/*\r\n ```\r\n4. Upload to PyPI:\r\n ```\r\n twine upload dist/*\r\n ```\r\n\r\nMake sure you have the latest versions of setuptools, wheel, and twine installed before building and uploading:\r\n```\r\npip install --upgrade setuptools wheel twine\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A tool to add version information to requirements.txt files",
"version": "0.1.8",
"project_urls": {
"Bug Reports": "https://github.com/Ralf12358/reqver/issues",
"Homepage": "https://github.com/Ralf12358/reqver",
"Source": "https://github.com/Ralf12358/reqver/"
},
"split_keywords": [
"requirements",
"version",
"pip"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "429a618e70b051ffeed3bfd798ccbdf4fa5f2312db8269461c1450894a0af5e2",
"md5": "6f25f31f7074b2ce00132580534194eb",
"sha256": "925010be93b7303c17e953d47cfb0039d7b81ce56f4430ba62362d7b22b8b463"
},
"downloads": -1,
"filename": "reqver-0.1.8.tar.gz",
"has_sig": false,
"md5_digest": "6f25f31f7074b2ce00132580534194eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6036,
"upload_time": "2024-07-21T18:09:40",
"upload_time_iso_8601": "2024-07-21T18:09:40.916154Z",
"url": "https://files.pythonhosted.org/packages/42/9a/618e70b051ffeed3bfd798ccbdf4fa5f2312db8269461c1450894a0af5e2/reqver-0.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-21 18:09:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ralf12358",
"github_project": "reqver",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "reqver"
}