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?
- Easier installation of Python packages
- Safer package installations secured by hashes, everywhere
- 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:
- Edit your
requirements.txt
file manually to add the new library - Run
pip install -r requirements.txt
to install the libraries listed there - Keep everything in sync by never forgetting to add libraries manually in
requirements.txt
😱 - 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:
- Installing that library in your SourceLair project
- Updating your
Pipfile
to include the new library there (human readable) - Update your
Pipfile.lock
file to include the new library and it's dependencies with exact hashes to ensure security and deterministic builds
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 andPipfile.lock
as JSON
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.