Package: pipm
pipmPython package management using pip, requirements file &setup.cfg.InstallationAdviced to install only inside virtualenvInstall from PyPIpip install pipmNote:This tool manipulates all your requirements file. So be sure to use version control software or take backup of your files to keep track of changes.QuickstartBothpipandpipmcommand will work as the same.Create a virtualenv for the project and install pipm withpipinstallpipmCreate an alias asalias pip=pipmor use as it is -pipmI. Installinstall all your dependencies from the base requirements file (requirements.txt)pipminstall
pipminstall--all# *requirements*.txt - all environment -> test/prod/dev2. Add new packages to projectpipminstallpkg-name
pipminstallpkg-name--dev# as development dependencypipminstallpkg-name--test# as testing dependency3. Removal of packagesRemove one or more packages. Their dependencies will also get uninstalled. No orphaned packages.pipmuninstallpkg-name4. update all your dependencies in requirements.txtpipmupdate
pipmupdate--devFeaturesNo new set of files.*-requirements.txtworks like the lockfile with pinned versionsJust a wrapper around the standard pip'sinstall/uninstallcommand. So all the cli options will workHandles multiplerequirementsfiles
andsetup.cfgstores abstract dependencies.Commands1. installa wrapper around standardpip installcommand and accepts all the standard optionsBelow are the things thatpipmbrings to the tableExtra functionalitywhen package names are given it will be saved to the requirements.txt file in the current directory.
If you haverequirementsdirectory structure withbase.txtinside then that file will be used. Otherwise it
will create one in the current directory.when no package name is given then it is equivalent to-r requirements.txtand it will install all requirements
from the current directoryAdditional options:
It will search for the matching one in the following pattern<name>-requirements.txtorrequirements/<name>.txtorrequirements-<name>.txtthe below saves to file when package name given otherwise equivalent to passing requirements file name.--dev- saves to development requirements--prod- saves to production requirements--test- saves to  testing requirements--doc- saves to  documentation requirements--env <name>- if you have any special set of requirements that belong to a separate file you could pass the name here.2. uninstalla wrapper around standardpip uninstallcommandaliasrmis availablewhen uninstalling a package, this command also checks packages that are no longer required by any of user installed
packages and removes themofcourse it removes the packages fromrequirementsfiles3. updatenew commandequivalent to callingpip installwith--upgradeflagupdate a single package or the whole environment when no argument given.by default the packages are updated interactivelyset--auto-updateto disable this4. save/freezeextends the standard freeze command to save the currently installed packagesDevelopmentclone the repository and create new virtualenvgit clone git@github.com:jnoortheen/pipm.git
cd pipm
pew new pipm -a .
pip install -r dev-requirements.txtto test from local sourcespip install -e .Commit message should followthisstyle-guide.Testingruninvoke testfrom the root directory.Alternatives and their problems (IMHO)pipenvgood for local development with only one virtual environment per projectNot good when we need to deploy over production server or keep multiple virtuals-envsit is better to usepewalone instead of the shell command that comes with thispip-toolsanother set of files to keep track of, additional commands to rememberpoetrymore robust thanpipenv~~the problems I faced are related to installing dependencies in remote servers/docker environments. ~~longer install/update times~~As the project matures this problem might get resolved. ~~since version 1.1 these are solved.new projects are to advised to use poetry when possible.dephellhaven't used it. But seems to handle requirements files as well as other formats.TODOs:rm will check whether a package is present in setup.cfg