An extended pip installer that updates requirements.txt
Project description
pipext
pipext is a utility to enhance Python's package installer pip. With pipext, when you install or uninstall a package, it automatically manages your requirements.txt file by appending, commenting out, or uncommenting package entries as needed.
Features
-
Automatic Requirements Management: On package installation,
pipextappends the installed package (with version) torequirements.txtor uncomments it if it's already there. -
Commenting on Uninstall: On package uninstallation, instead of removing the package from
requirements.txt,pipextcomments it out, making it easy to keep track of previously used packages. -
Selective Dependency Addition: Unlike traditional approaches,
pipextensures only the primary installed package is added to therequirements.txt, ignoring the dependencies that come along with them. -
Support for Installation With Dependencies Included Commands:
pipextprovides support for installing packages with dependencies added into the commands such as "python -m pip install -U 'channels[daphne]'" ensuring broader compatibility. -
Custom Requirements File Creation: Need different requirement files for different environments like production or local?
pipextgot you covered. Use the-eflag to specify which environment file to update. For example:pipext install -e production somepackagewill update therequirements/production.txtfile.
Installation
To install pipext, run:
pip install pipext
This will download and install the pipext utility from PyPI, allowing you to use it directly from your terminal or command prompt.
Usage
Install a Package
pipext install package_name
This will:
- Install the package using
pip. - Add the package with its specific version to
requirements.txtor uncomment it if it's already present (but commented out).
Uninstall a Package
pipext uninstall package_name
This will:
- Uninstall the package using
pip. - Comment out the package in
requirements.txt.
Install/Uninstall a Package to a Specific Environment
pipext install -e production package_name
or
pipext uninstall -e production package_name
This will:
- Install/Uninstall the package using
pip. - Add or comment out the package with its specific version to
requirements/production.txtor uncomment it if it's already present (but commented out).
Why pipext?
Managing a requirements.txt can be tedious. You install and uninstall packages during development, and sometimes it's easy to forget to update requirements.txt accordingly. pipext eases this process by automatically managing your requirements file as you modify your environment.
Contributing
Any kind of contribution is appreciatable! Please open an issue or submit a pull request on my GitHub repository.
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 pipext-0.2.3.tar.gz.
File metadata
- Download URL: pipext-0.2.3.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
670aed1c951c0a7837e1bce857fed8accbb4877f5bc3efb417c585242a6661df
|
|
| MD5 |
86ff3dde13d800aa32e96158425c42ea
|
|
| BLAKE2b-256 |
bb94c63b1fe5beb949fcd8c093421396e32e1532ea96ba5ade71ea0f825f9dac
|
File details
Details for the file pipext-0.2.3-py3-none-any.whl.
File metadata
- Download URL: pipext-0.2.3-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5acc515f2a4cc51b7c5fc61739040cad8ef5ff8633645ffd0f66631312760574
|
|
| MD5 |
9c996cc387274e658c064fe3d267d3da
|
|
| BLAKE2b-256 |
f0d084b0706eb598eb91395d687489a39c9b8fa891dac0ab97c0917d0662fc71
|