Skip to main content

Wrapper around pip commands to auto-update requirements file

Project description

pipm

Python package management workflow using pip, requirements file & setup.cfg as its metadata. (For the time being and old world of python)

Installation

  • Adviced to install only inside virtualenv as this will replace pip executable

Install from PyPI

pip install six
pip install pipm

Or Install directly from the GitHub

pip install -e git://github.com/jnoortheen/pipm.git@master#egg=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 an alias as alias pip=pipm and you are good to go.

install all your dependencies from the requirements file

  • to install only from requirements.txt

pipm install

  • to install from all *requirements*.txt

pipm install --all

installation

pipm install pkg-name or pip install pkg-name

installation as development dependency

pipm install pkg-name --dev

installation as testing dependency

pipm install pkg-name --test

removal

pipm uninstall pkg-name

update all your dependencies

pipm update

including development dependencies

pipm install --dev

Usage

  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: 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. --env <name> - if you have any special set of requirements that belong to a separate file you could pass the name here. It will search for the matching one in the following pattern <name>-requirements.txt or requirements/<name>.txt or requirements-<name>.txt
  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 the 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

Features

  1. Just a wrapper around the standard pip's install/uninstall command. So all the cli options will work
  2. Handles multiple requirements files
  3. No new set of files. requirements files contain pinned dependecies and setup.cfg contain abstract dependencies.

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 .

Testing

  • run invoke test from the root directory.

Version compatibility

the package is versioned in accordance with pip major version number. pipm-9.* will be compatible with pip-9 and such.

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
    • better than pipenv and do not interfere much in environment management with pew
    • the problems I faced are related to installing dependencies in remote servers/docker environments. As the project matures this problem might get resolved.

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

pipm-10.4.3.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

pipm-10.4.3-py2.py3-none-any.whl (26.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pipm-10.4.3.tar.gz.

File metadata

  • Download URL: pipm-10.4.3.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.4 CPython/3.7.0 Linux/4.18.3-1-MANJARO

File hashes

Hashes for pipm-10.4.3.tar.gz
Algorithm Hash digest
SHA256 5476d7d5faf1a94358ee435a21bdbb8790166cd58566ce5902e3a3fe5d2624dd
MD5 1959de31242e3e8e094b1ef96cd947ce
BLAKE2b-256 4de6e0a53fea569e946b4dc29ce5f5e4b13c3bd141b9a2be2fe5fd2d51db47a0

See more details on using hashes here.

File details

Details for the file pipm-10.4.3-py2.py3-none-any.whl.

File metadata

  • Download URL: pipm-10.4.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.4 CPython/3.7.0 Linux/4.18.3-1-MANJARO

File hashes

Hashes for pipm-10.4.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 67c36b8d9560e95acab810358fb1612952a3c747759b237e28d84c0a1b97442e
MD5 3aba31b62e7d2f8ca4fd8d2597e906ee
BLAKE2b-256 eccaa26aed5d6fb32f816a33e038dc56a8bd636f4a35b41b74d964d018a2621b

See more details on using hashes here.

Supported by

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