Skip to main content

Wraps pip and venv to install scripts

Project description

PIPIS

tests Build Status
package PyPI version Supported versions PyPI - Status

Somewhere between pip and pipsi

"pipis" stands for "pip isolate"
and "pipi" is the french for "peepee" which is a fun name but pipi was already taken…

Actually it is a rewrite of pipsi but with venv instead of virtualenv.

What does it do?

Pipis is a wrapper around venv and pip which installs scripts provided by python packages into separate venvs to shield them from your system and each other.

It creates a venv in ~/.local/share/pipis/venvs/, update pip, installs the package, and links the package's scripts to ~/.local/share/pipis/bin/. These directory can be changed respectively through the environment variables PIPIS_VENVS and PIPIS_BIN.

Why not pipsi?

Because i do not care about Python 2, and virtualenv copies python's binaries while venv just symlink them (which i think is cleaner, but it still copies pip which is not clean…).

How to install

Automatic

Coming soon…

Manual

Create the pipis venvs and bin directories:

mkdir -p ~/.local/share/pipis/{venvs,bin}

Create and activate the pipis virtual environment:

python3 -m venv ~/.local/share/pipis/venvs/pipis
source ~/.local/share/pipis/venvs/pipis/bin/activate

Upgrade the pip package:

pip install -U pip

Install pipis:

pip install pipis

Exit the virtual environment:

deactivate

Link the pipis script into the "global" bin directory:

ln -s ~/.local/share/pipis/venvs/pipis/bin/pipis ~/.local/share/pipis/bin/

Add the pipis "global" bin directory to your PATH:

export PATH="~/.local/share/pipis/bin:${PATH}"

How to update

pipis update pipis

How to uninstall

pipis uninstall pipis

How to use

Show help

$ pipis -h
usage: pipis [-h] [-v] {version,freeze,search,install,update,uninstall} ...

Pipis installs Python packages into their own dedicated virtualenv to shield
them from your system and from each other. Virtualenvs are created in
`PIPIS_VENVS` (default: `~/.local/share/pipis/<package>`) and links the
scripts to `PIPIS_BIN` (default: `~/.local/share/pipis/bin/`).

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         enable verbose ouput

available commands:
  {version,freeze,search,install,update,uninstall}
    version             show pipis version
    freeze              output installed packages in requirements format
    search              search for PyPI packages whose name or summary
                        contains <query>
    install             install packages
    update              update packages
    uninstall           uninstall packages

You can also invoke --help on each commands.

Install package(s)

$ pipis install ansible
Package 'ansible' will be installed.
Do you want to continue [y/N]? y
Successfully installed ansible

Unattended install package(s)

$ pipis install -y awscli
Successfully installed awscli

Update package(s)

$ pipis update ansible
Package 'ansible' will be updated.
Do you want to continue [y/N]? y
Successfully updated ansible

List installed packages

$ pipis freeze
ansible==2.8.1
awscli==1.16.181
gcal2redmine==0.2.0
gitignore-cli==1.0.3
pipenv==2018.11.26
pipis==2.0.0
poetry==0.12.16
speedtest-cli==2.1.1
tldr==0.4.4
youtube-dl==2019.6.8

Uninstall package(s)

$ pipis uninstall ansible
Package 'ansible' will be uninstalled.
Do you want to continue [y/N]? y
Successfully uninstalled ansible

Credits

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

2.0.0

Added

  • Add search command, to search packages on PyPI.

Changed

  • Complete rewrite with argparse (removing depency to Click)

Removed

  • The list command, it had no real purpose
  • The possibility to install multiple package at once, will be re-added later
  • The possibility to upgrade all package with pipis update, will be re-added later

1.5.0

Added

  • Add -I or --ignore-installed option on install and update commands.
  • Add -U or --upgrade option on install command.

Changed

  • Move some portion of code into separate functions to make the code easier to read.
  • Updating an uninstalled package will install it, instead of failing.
  • While creating symlinks, if the target already exists it will be replaced, instead of failing.

Fixed

  • Fix some linting warnings.

1.4.0

Added

  • Install option -s or --system-site-packages to give access to system site-packages to venv.
  • Allow to specify package version (ex: ansible==2.4.0).
  • Add a package into a package's venv with -d or --dependency option.
  • Add -v or --verbose option on install and update commands.

1.3.1

Fixed

  • Refactor environment variable retrieval.

1.3.0

Added

  • Destination venv directory can be set through the environment variable PIPIS_VENV.
  • Destination bin directory can be set through the environment variable PIPIS_BIN.

Changed

  • Format list output like pip's one.

Fixed

  • Remove venv created in case of inexistant package install attempt.
  • Raise error when the package is a library (has no user script).
  • Raise error when the symlink destination already exists.
  • Raise error when trying to update an inexistant package.

1.2.0

Added

  • Add freeze command to output installed packages in requirements format.
  • Add command to show pipis version.

Changed

  • Show version beside package name in list command.
  • Improve existing and add new help texts.
  • Add short from -y for --yes argument.
  • Factorize duplicate code.

Fixed

  • Fix pep8 and pylint warnings.

1.1.0 - 2018-05-18

Added

  • Add -r/--requirement for the remove command to allow passing requirements.txt file.
  • Add -r/--requirement for the update command to allow passing requirements.txt file.
  • Add -r/--requirement for the install command to allow passing requirements.txt file.

Changed

  • Change output information format fo when package are already/not installed.

1.0.1 - 2018-05-17

Fixed

  • Reload sys.path and clean it after to avoid issue with "distribution not found".

1.0.0 - 2018-05-17

Added

  • Everything.

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

pipis-2.0.0.post2.tar.gz (12.2 kB view hashes)

Uploaded Source

Built Distribution

pipis-2.0.0.post2-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

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