Skip to main content

pipm

Build Status

Python package management using pip, requirements file & setup.cfg.

Installation

  • Adviced to install only inside virtualenv

Install from PyPI

pip install pipm

Note:

  • 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.

Quickstart

  • Both pip and pipm command will work as the same.
  • Create a virtualenv for the project and install pipm with
pip install pipm
  • Create an alias as alias pip=pipm or use as it is - pipm

I. Install

  • install all your dependencies from the base requirements file (requirements.txt)
pipm install
pipm install --all  # *requirements*.txt - all environment -> test/prod/dev

2. Add new packages to project

pipm install pkg-name
pipm install pkg-name --dev # as development dependency
pipm install pkg-name --test # as testing dependency

3. Removal of packages

  • Remove one or more packages. Their dependencies will also get uninstalled. No orphaned packages.
pipm uninstall pkg-name

4. update all your dependencies in requirements.txt

pipm update
pipm update --dev

Features

  1. No new set of files. *-requirements.txt works like the lockfile with pinned versions
  2. Just a wrapper around the standard pip's install/uninstall command. So all the cli options will work
  3. Handles multiple requirements files and setup.cfg stores abstract dependencies.

Commands

1. install

  • a wrapper around standard pip install command and accepts all the standard options

Below are the things that pipm brings to the table

  1. Extra functionality
    • when package names are given it will be saved to the requirements.txt file in the current directory. If you have requirements directory structure with base.txt inside 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.txt and it will install all requirements from the current directory
  2. Additional options: It will search for the matching one in the following pattern <name>-requirements.txt or requirements/<name>.txt or requirements-<name>.txt the below saves to file when package name given otherwise equivalent to passing requirements file name.
    1. --dev - saves to development requirements
    2. --prod - saves to production requirements
    3. --test - saves to testing requirements
    4. --doc - saves to documentation requirements
    5. --env <name> - if you have any special set of requirements that belong to a separate file you could pass the name here.

2. uninstall

  • a wrapper around standard pip uninstall command
  • alias rm is available
  • when uninstalling a package, this command also checks packages that are no longer required by any of user installed packages and removes them
  • ofcourse it removes the packages from requirements files

3. update

  • new command
  • equivalent to calling pip install with --upgrade flag
  • update a single package or the whole environment when no argument given.
  • by default the packages are updated interactively
    • set --auto-update to disable this

4. save/freeze

  • extends the standard freeze command to save the currently installed packages

Development

  • clone the repository and create new virtualenv
git clone git@github.com:jnoortheen/pipm.git
cd pipm
pew new pipm -a .
pip install -r dev-requirements.txt
  • to test from local sources
pip install -e .
  • Commit message should follow this style-guide.

Testing

  • run invoke test from the root directory.

Alternatives and their problems (IMHO)

  1. pipenv
    • good for local development with only one virtual environment per project
    • Not good when we need to deploy over production server or keep multiple virtuals-envs
    • it is better to use pew alone instead of the shell command that comes with this
  2. pip-tools
    • another set of files to keep track of, additional commands to remember
  3. poetry
    • more robust than pipenv
    • ~~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.
  4. dephell
    • haven'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

Metadata

Release files for pipm 22.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipm 22.2.3
File Size Uploaded
pipm-22.2.3.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipm 22.2.3
File Interpreter ABI Platform
pipm-22.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / pipm-22.2.3.tar.gz

Download URL pipm-22.2.3.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e974d67d410b56403fa70a8a14c3a9ef9f458f9fb977ef5112d74b625beda43
BLAKE2b-256 checksum
How to use checksums
26c4a0fb06eb27d5768fa5ea09507315dd6f7c788835729ebc2bd882b4210618
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/28.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.53.0 importlib-metadata/4.11.1 keyring/21.5.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.12

Release files / pipm-22.2.3-py3-none-any.whl

Download URL pipm-22.2.3-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d354e588d5bed580be1113451ec905d66c1ab572fd4ff9dbfa6040c4f87b11f1
BLAKE2b-256 checksum
How to use checksums
7cd4a9db7d67e0abfdacc7cc53e97e345a53fd2e1be2030ab11583919772627d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/28.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.5 tqdm/4.53.0 importlib-metadata/4.11.1 keyring/21.5.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.8.12

Release history Release notifications | RSS feed

This release

22.2.3 This release

2 release files

22.2.2

2 release files

22.2.1

2 release files

20.2.4

2 release files

20.2.0

2 release files

20.1.0

3 release files

20.0.0

1 release file

19.3.5

1 release file

19.0.0

1 release file

18.6.2

1 release file

18.6.1

1 release file

18.5.1

1 release file

18.5

1 release file

18.4.1

1 release file

18.4

1 release file

18.3

1 release file

18.2.0

1 release file

18.1

1 release file

18.0.2

1 release file

18.0.1

1 release file

18.0.0

1 release file

10.4.4

1 release file

10.4.3

2 release files

10.4.2

1 release file

10.4.1

1 release file

10.4.0

1 release file

10.3.0

1 release file

10.2.0

1 release file

10.1.0

1 release file

10.0.0

1 release file

9.0.0

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9

1 release file

0.8

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6

1 release file

0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page