Skip to main content

Poetry Plugin Pyenv

This package aims to make working with Poetry and Pyenv a seamless experience.

Installation

The easist and recommended way to install is using Poetry's self add command.

poetry self add poetry-plugin-pyenv

If you used pipx to install Poetry you can add the plugin via the pipx inject command.

pipx inject poetry poetry-plugin-pyenv

Otherwise, if you used pip to install Poetry you can add the plugin packages via the pip install command.

pip install poetry-plugin-pyenv

Usage

Enabling

This plugin work in conjunction with the virtualenvs.prefer-active-python option. Therefore the first step to using this plugin is enabling that option.

To enable the option locally you can use the following command.

poetry config virtualenvs.prefer-active-python true --local

To, instead, enable the option globally use the following command.

poetry config virtualenvs.prefer-active-python true

Once enabled this plugin should work transparently to enable seamless interoperability with Poetry and Pyenv. To learn more about what this plugin does behind the scenes see the Behavior section.

Behavior

Poetry Plugin Pyenv works by treating python constraint declared in the tool.poetry.dependencies of pyproject.toml as a source of truth for Pyenv's local python version. To do this it will exercise the following behavior.

Pyenv already has a local version

If Pyenv already has a local version it will check if the local version matches the constraint specified in the pyproject.toml. If the constraint is not satisfied it will proceed to selecting a new python version. If the constraint is satisfied Poetry's virtualenv will be created using the local version thanks to virtualenvs.prefer-active-python.

Pyenv has no local version

If Pyenv does not have a local version set it will proceed to selecting a new python version.

Selecting a new python version

If a new python version needs to be selected the list of installable versions available to Pyenv will be checked against the constraint. From this list the latest possible version to satisfy the constraint will be selected. If this version is not installed it will be installed. It will then be set as Pyenv's local version and Poetry's virtualenv will be [re]created.

Metadata

Release files for poetry-plugin-pyenv 0.2.1

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-plugin-pyenv 0.2.1
File Size Uploaded
poetry_plugin_pyenv-0.2.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poetry-plugin-pyenv 0.2.1
File Interpreter ABI Platform
poetry_plugin_pyenv-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / poetry_plugin_pyenv-0.2.1.tar.gz

Download URL poetry_plugin_pyenv-0.2.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4bbc386f2d68a980ad77fef2a5a667bd61b3a4ee35891967bd91d29769f72167
BLAKE2b-256 checksum
How to use checksums
aba55564cf91dedd964d6bfcde238d199deb1b1fcc974faa3356ca6d91f294f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.8.18 Linux/6.8.0-1014-azure

Release files / poetry_plugin_pyenv-0.2.1-py3-none-any.whl

Download URL poetry_plugin_pyenv-0.2.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9b727213a4e72deb0399f0ba31f7eda2af5cbe148fec26d5586f5f2ad16ee47
BLAKE2b-256 checksum
How to use checksums
e42c8e8ede7c87463195d9eaf6e1a430f4e6ed93f3fb0a4923b762a4b1f92f61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.8.18 Linux/6.8.0-1014-azure

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.4

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