Βuilt-in Pipenv support for better dependency management in Python

We are excited to announce built-in support for Pipenv in all Python projects on SourceLair (existing and new ones).

Pipenv is the officially recommended Python packaging tool from Python.org and it's one of the amazing pieces of software built by Kenneth Reitz.

What does that mean for you?

  1. Easier installation of Python packages
  2. Safer package installations secured by hashes, everywhere
  3. Deterministic builds with dependencies that behave consistently from development to production

Pipenv in the terminal

Before Pipenv, to install a library in your SourceLair project reliably, you had to:

  1. Edit your requirements.txt file manually to add the new library
  2. Run pip install -r requirements.txt to install the libraries listed there
  3. Keep everything in sync by never forgetting to add libraries manually in requirements.txt 😱
  4. Keep "development only" libraries stored in a different file (usually named requirements-dev.txt) and manage them manually

Now, all you have to do is run pipenv install yourlibrary and Pipenv will take care of:

  1. Installing that library in your SourceLair project
  2. Updating your Pipfile to include the new library there (human readable)
  3. Update your Pipfile.lock file to include the new library and it's dependencies with exact hashes to ensure security and deterministic builds

Pipenv screencast

To install a "development only" library, just run pipenv install --dev yourlibrary and Pipenv will take care of the rest automatically!

Pipenv in the Command Palette

Besides using pipenv command in your terminal, you can also use Pipenv via the Command Palette with the following commands:

  • Pipenv: Install dependencies from Pipfile
  • Pipenv: Lock Pipfile dependencies in Pipfile.lock

A few more goodies

  • Cloning a project with a Pipfile in it's root directory, will automatically install all libraries listed there
  • TOML syntax highlighting is available in the editor
  • SourceLair will automatically highlight Pipfile as TOML and Pipfile.lock as JSON

Are you ready to roll?

Open your SourceLair workspace to take Pipenv for a spin!

P.S.: This update introduces also the deprecation of pip as the default package manager for Python projects on SourceLair and it's replacement by Pipenv.