Skip to main content

flitenv

Manage venvs and dependencies for flit projects.

Features:

  • Supports the most modern metadata format described in PEP 621.
  • Locks dependencies using pip-tools.
  • Multiple venvs per project to ensure a better isolation of environments.
  • No vendor lock, under-the-hood uses popular and well-maintained technologies and tool-agnostic formats.
  • Cross-platform.
  • Battle-tested.

Installation

python3 -m pip install flitenv

Usage

Basics:

  1. The project stores metadata in a flit-compatible format, as described in the flit documentation. The recommended ways is to us the new [project] section introduced in PEP 621.
  2. Direct required production dependencies of the project are described in dependencies list. This environment is called main.
  3. Development environments are described in the [project.optional-dependencies] section. Good examples of such environments are test, lint, and doc.
  4. For each environment, flitenv will create a separate venv in .venvs to ensure a good isolation.
  5. "Lock file" is a file with exact versions of all dependencies of the project in the given environment, including the transitive ones.
  6. Flitenv uses requirements.txt files generated by pip-tools as lock files.
  7. It is recommend to generate a lock file for (and only for) the main environment.
  8. flitenv follows the flit philosophy. It provides only the most helpful and flexible commands, and you can do anything you ever need by combining them with each other and with other tools.

Below are usage examples. Each example uses lint as the target environment and flake8 as a command we want to run in this environment.

  • flitenv install lint: install dependencies. If the venv doesn't exist, it will be created. Can also be used to upgrade dependencies when the lock file has been changed.
  • flitenv run lint flake8: run a command. If the venv doesn't exist, it will be created, and the dependencies will be installed.
  • flitenv lock lint: generate lock file (requirements-lint.txt) for the env.
  • flitenv main lock: generate lock file (requirements.txt) for the main env. If there is no env-specific lock file, this one will be used instead.
  • flitenv main lock -c ../other-project/requirements.txt: generate lock file using lock file from another project as a reference. It allows to ensure compatibility of lock files accross multiple projects.
  • rm requirements.txt && flitenv main lock: upgrade all dependencies in the lock file.
  • rm -rf .venvs/lint && flitenv install lint: re-create the venv. It is usefult to ensure that all old dependencies.
  • flit build: build a distribution for the project.
  • flit install --symlink --python $(which python3.9) --deps=none: symlink the project into the given Python interpreter without installing dependencies. It is helpful if you want to have nice go-to-definition in vscode across multiple projects.

Release files for flitenv 0.4.0

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

Source distribution (sdist)

Source distribution for flitenv 0.4.0
File Size Uploaded
flitenv-0.4.0.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flitenv 0.4.0
File Interpreter ABI Platform
flitenv-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / flitenv-0.4.0.tar.gz

Download URL flitenv-0.4.0.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
737f07f3e58e453ad0b46db59b4a4ade02a5016ddbbb62f8fd414d54b8379da1
BLAKE2b-256 checksum
How to use checksums
62ef7084d1601ac972a2bd63e48c6b29dbd222ac68c70b65257336128ba99a4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release files / flitenv-0.4.0-py3-none-any.whl

Download URL flitenv-0.4.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a6ded123ca3545851a045cdffc7e82f6a46640fd0488f88df7b751d0b2bd6f6
BLAKE2b-256 checksum
How to use checksums
f04029af88c32930ddf237dcb837d6b6a480ef43725a0822b6ae92713c451b56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.28.1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

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