Skip to main content

A wrapper for pip to save packages in requirements files.

Project description

build pipw python coverage license

A wrapper for pip to save packages in requirements files similar to npm.

There are better alternatives to pip (like Pipenv), but this was created for those who want or need to continue using pip. For example, those who collaborate in projects that use pip requirements files.

Installing

$ pip install pipw

Usage

pipw (install|uninstall) [-e] <package>... [options]

Options:

-s, --save           Save packages to the requirements file. This is default
                     unless --no-save. Packages are saved in
                     requirements.txt unless a custom configuration is used.
-n, --no-save        Prevent save packages to the requirements file.
--config <path>      Pass a custom config file. By default it looks for a
                     .pipwrc file in the directory where the command is
                     executed, or in the user's home directory.
-m, --env <name>     Save in a environment previously declared in the config
                     file.
--save-to <path>     Save to a custom file.
--no-detect-version  Do not detect installed version, and save package
                     version only if the version is passed.
--help               Show this message and exit.

All pip commands and options are still available.

Config file

You can create a .pipwrc file to use a custom configuration. By default it looks for the file in the directory where the command is executed, or in the user’s home directory. You can also pass a custom file to the --config option.

Example of a config file:

requirements: requirements.txt
specifier: ~=
detect_version: true
envs:
    dev: requirements/dev.txt

Environments

As you can see, you can set environment files in the configuration file:

requirements: requirements/prod.txt
envs:
    dev: requirements/dev.txt
    test: requirements/test.txt

Use the -m (or –env) option to save the packages in an environment file:

$ pipw install pytest -m test

If no environment is passed, the value defined in requirements are used by default. If this value is not defined, a requirements.txt file is used by default. These files are created automatically if they do not exist.

The uninstall command will remove the package in all files, unless the -m option is passed.

Tests

Tests are in tests/. To run the tests use one of these commands:

$ make tests
$ make wip-tests
$ make review-tests

You can also pass the environment. For example:

$ make tests env=py35

Authors

  • Daniel Ramos

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

pipw-1.0.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipw-1.0.5-py2.py3-none-any.whl (8.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pipw-1.0.5.tar.gz.

File metadata

  • Download URL: pipw-1.0.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pipw-1.0.5.tar.gz
Algorithm Hash digest
SHA256 a46ae720f3ea670aeb3ae28b56acd333bdb00730257a81120af1f4cded204277
MD5 f4395b6bbf4f4846125f443da712b455
BLAKE2b-256 a19ab0410d328bce9d7e4572c0ee0f5f5cff1599dc2476240bee14f6ab437e1c

See more details on using hashes here.

File details

Details for the file pipw-1.0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pipw-1.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e88271baaddcc2fc982fd35a05700e4d4beaa7354e39869295a9b88d09345044
MD5 e77a5a71f8700259d37c45c6493b50c6
BLAKE2b-256 9fce679ee2ea287d314e02b6ae9cc5c93c10be62affbe007dbc86ae2cffb1d1d

See more details on using hashes here.

Supported by

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