Skip to main content

Poetry Plugin for Bundling Local Dependencies

Project description

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

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

poetry_shared_venv_plugin-0.2.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poetry_shared_venv_plugin-0.2.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file poetry_shared_venv_plugin-0.2.3.tar.gz.

File metadata

File hashes

Hashes for poetry_shared_venv_plugin-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3e2a4a5211fc2bf198edbd4eab61d880df3b7be408212338e41b2e6598d3fa4b
MD5 4d56e4ed3b91bd09fbd9c67513053655
BLAKE2b-256 3f216db507b4db8018ee6a7af9b81e4a258f9a52bbb8fc3818f24821c65c01a3

See more details on using hashes here.

File details

Details for the file poetry_shared_venv_plugin-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_shared_venv_plugin-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 22c0bbcf36d1720764e7621ac5235b5455f7d55ddde672a7cff0c23fc0192295
MD5 a431d92882e2adb4871bf62a98a3651c
BLAKE2b-256 43795f43ac5fafee63c5faefbbedacab173c98b2386184d3eba3e17604ea2528

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page