Skip to main content

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.txt or requirements-dev.txt.
  • Appends new dependencies to the appropriate requirements file without duplicating entries.
  • Creates requirements.txt or requirements-dev.txt if 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:

  1. Runs pip freeze to list the currently installed packages.
  2. Read the existing entries from both requirements.txt and requirements-dev.txt.
  3. Identify any new dependencies that are not listed in either file.
  4. 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:

  1. Fork the repository.
  2. Create a new branch for your feature.
  3. Add your changes.
  4. 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

manage_requirements_files-0.1.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

manage_requirements_files-0.1.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file manage_requirements_files-0.1.3.tar.gz.

File metadata

File hashes

Hashes for manage_requirements_files-0.1.3.tar.gz
Algorithm Hash digest
SHA256 39b441c7c9b366707681635d273a3b5f52fbd6777c94b8a002e4843a6377d990
MD5 1e7242e1e1edeb6dab9e84c09d16ef48
BLAKE2b-256 8d25e20e89b40276acb7d1cac0ed045d5f0aedcd7aaeeccbe20a18df8a12fa78

See more details on using hashes here.

File details

Details for the file manage_requirements_files-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for manage_requirements_files-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90fe36848d005a211a11d213db96d18b48e9882b501ef72cbce0f165146ad70d
MD5 80a7367057b971a4496710094a6265a0
BLAKE2b-256 51dbce476fe74acd0c4460a34a2a5a7fe516a96f0275e80bca80da8f7a2e7164

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page