Skip to main content

No project description provided

Project description

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.

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_plugin_pyenv-0.2.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

poetry_plugin_pyenv-0.2.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file poetry_plugin_pyenv-0.2.1.tar.gz.

File metadata

  • Download URL: poetry_plugin_pyenv-0.2.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.8.18 Linux/6.8.0-1014-azure

File hashes

Hashes for poetry_plugin_pyenv-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4bbc386f2d68a980ad77fef2a5a667bd61b3a4ee35891967bd91d29769f72167
MD5 0780db9bce1caf605ecbd89be7bd8959
BLAKE2b-256 aba55564cf91dedd964d6bfcde238d199deb1b1fcc974faa3356ca6d91f294f4

See more details on using hashes here.

File details

Details for the file poetry_plugin_pyenv-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_plugin_pyenv-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9b727213a4e72deb0399f0ba31f7eda2af5cbe148fec26d5586f5f2ad16ee47
MD5 c39243a6413e8e8679f89556597865a5
BLAKE2b-256 e42c8e8ede7c87463195d9eaf6e1a430f4e6ed93f3fb0a4923b762a4b1f92f61

See more details on using hashes here.

Supported by

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