Skip to main content

Poetry Shared Venv Plugin

SonarCloud Status

Vulnerabilities Bugs Code Smells Technical Debt Lines of Code

Maintainability Rating Reliability Rating Security Rating Quality Gate Status

Centralize your monorepo submodules in a single virtual environment.

Motivation

In a monorepo-style project with multiple poetry projects in the same repository, and each project has its own virtual environment, installing dependencies can be a time-consuming task, especially when the dependencies are shared among the projects.

The IDEs also have a hard time switching between them as you navigate through the codebase.

This plugin aims to solve this problem by centralizing the virtual environments in a single directory, very similar to how yarn workspaces works.

Install

poetry self add poetry-shared-venv-plugin

Usage

  1. Create a pyproject.toml file in the root of your repository.
  2. Add the shared-venv section to the pyproject.toml file.
[tool.poetry]
name = "demo"
version = "0.1.0"
description = "Python workspace"
authors = []
package-mode = false

[tool.poetry.dependencies]
python = "^3.12"

[tool.shared-venv]
enabled = true
root = true
include = [
    "packages/**"
]

3. Add your packages to the packages directory. (or any other directory you want)

Now, when you run the poetry commands to add, update or remove the dependencies, the plugin will install them in the shared virtual environment in the root of the repository, but it will still generate the poetry.lock file in the package directory as usual.

The root poetry.lock file will be generated in the root of the repository.

Contributing

Change Log

Metadata

Release files for poetry-shared-venv-plugin 0.2.3

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

Source distribution (sdist)

Source distribution for poetry-shared-venv-plugin 0.2.3
File Size Uploaded
poetry_shared_venv_plugin-0.2.3.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poetry-shared-venv-plugin 0.2.3
File Interpreter ABI Platform
poetry_shared_venv_plugin-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / poetry_shared_venv_plugin-0.2.3.tar.gz

Download URL poetry_shared_venv_plugin-0.2.3.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3e2a4a5211fc2bf198edbd4eab61d880df3b7be408212338e41b2e6598d3fa4b
BLAKE2b-256 checksum
How to use checksums
3f216db507b4db8018ee6a7af9b81e4a258f9a52bbb8fc3818f24821c65c01a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / poetry_shared_venv_plugin-0.2.3-py3-none-any.whl

Download URL poetry_shared_venv_plugin-0.2.3-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22c0bbcf36d1720764e7621ac5235b5455f7d55ddde672a7cff0c23fc0192295
BLAKE2b-256 checksum
How to use checksums
43795f43ac5fafee63c5faefbbedacab173c98b2386184d3eba3e17604ea2528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

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