A utility to manage project dependencies for development and production.
Project description
Manage Requirements Files
manage-requirements-files is a Python CLI tool designed to help developers efficiently manage their project dependencies. It automates the updating of requirements.txt and requirements-dev.txt by appending new dependencies from the activated Python environment.
Features
- Detects newly installed packages not listed in
requirements.txtorrequirements-dev.txt. - Appends new dependencies to the appropriate requirements file without duplicating entries.
- Creates
requirements.txtorrequirements-dev.txtif they don't already exist.
Installation
Install manage-requirements-files globally using pip:
pip install manage-requirements-files
Usage
Ensure you activate your project's virtual environment before using the commands:
source /path/to/your/venv/bin/activate # for Unix-like systems
\path\to\your\venv\Scripts\activate # for Windows
Updating Production Dependencies
After installing your production dependencies with pip install, update requirements.txt by running:
manage-dependencies prod
This populates requirements.txt with all recently installed production dependencies.
Updating Development Dependencies
Following the installation of development dependencies, update requirements-dev.txt by running:
manage-dependencies dev
Note
Install dependencies incrementally and categorize them as production or development before running the respective command. Attempting to separate a mixed set of installed dependencies may not yield the desired results.
How It Works
When manage-dependencies is executed, it:
- Runs
pip freezeto list the currently installed packages. - Read the existing entries from both
requirements.txtandrequirements-dev.txt. - Identify any new dependencies that are not listed in either file.
- Appends these new dependencies to the appropriate file based on the selected mode.
Global Installation and Environment-Specific Usage
Install manage-requirements-files once on your system to use across all Python projects. The tool will adjust requirements.txt or requirements-dev.txt in the current active virtual environment, allowing you to manage dependencies without needing to install the tool in each environment.
Contributing
Contributions are welcome! If you would like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature.
- Add your changes.
- Submit a pull request.
Please make sure to update tests as appropriate.
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Guilherme Gouw - guilherme.gouw@gmail.com
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file manage_requirements_files-0.1.3.tar.gz.
File metadata
- Download URL: manage_requirements_files-0.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39b441c7c9b366707681635d273a3b5f52fbd6777c94b8a002e4843a6377d990
|
|
| MD5 |
1e7242e1e1edeb6dab9e84c09d16ef48
|
|
| BLAKE2b-256 |
8d25e20e89b40276acb7d1cac0ed045d5f0aedcd7aaeeccbe20a18df8a12fa78
|
File details
Details for the file manage_requirements_files-0.1.3-py3-none-any.whl.
File metadata
- Download URL: manage_requirements_files-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90fe36848d005a211a11d213db96d18b48e9882b501ef72cbce0f165146ad70d
|
|
| MD5 |
80a7367057b971a4496710094a6265a0
|
|
| BLAKE2b-256 |
51dbce476fe74acd0c4460a34a2a5a7fe516a96f0275e80bca80da8f7a2e7164
|