Skip to main content

pipw

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

Release files for pipw 1.0.5

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

Source distribution (sdist)

Source distribution for pipw 1.0.5
File Size Uploaded
pipw-1.0.5.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipw 1.0.5
File Interpreter ABI Platform
pipw-1.0.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 15.1 kB

Release files / pipw-1.0.5.tar.gz

Download URL pipw-1.0.5.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a46ae720f3ea670aeb3ae28b56acd333bdb00730257a81120af1f4cded204277
BLAKE2b-256 checksum
How to use checksums
a19ab0410d328bce9d7e4572c0ee0f5f5cff1599dc2476240bee14f6ab437e1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pipw-1.0.5-py2.py3-none-any.whl

Download URL pipw-1.0.5-py2.py3-none-any.whl
Size 8.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e88271baaddcc2fc982fd35a05700e4d4beaa7354e39869295a9b88d09345044
BLAKE2b-256 checksum
How to use checksums
9fce679ee2ea287d314e02b6ae9cc5c93c10be62affbe007dbc86ae2cffb1d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.2

1 release file

1.0.0

1 release file

0.9.15

1 release file

0.9.10

1 release file

0.9.5

2 release files

0.9.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.9

2 release files

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