Let Tox know about Poetry's development dependencies
Project description
Introduction
Tox plugin to let Tox know about Poetry’s development dependencies.
Repositories
Distributions:
Source code:
Usage
Installation
It is a plugin for Tox and it is available on PyPI, install it however best fits the workflow. A useful thing to know though, is that starting with Tox version 3.8 it is possible to enforce the installation (in an isolated environment) of the plugin directly from within the tox.ini file, thanks to the requires setting (Tox 3.2) and the auto-provisioning feature (Tox 3.8):
[tox]
requires =
tox-poetry-dev-dependencies
https://tox.readthedocs.io/en/latest/config.html#conf-requires
https://tox.readthedocs.io/en/latest/example/basic.html#tox-auto-provisioning
By default the plugin does not do anything. Use one of the following settings to activate the corresponding features.
add_poetry_dev_dependencies
Set the testenv setting add_poetry_dev_dependencies to True to let Tox install Poetry’s development dependencies in the test environment.
[testenv:example]
# ...
add_poetry_dev_dependencies = True
poetry_use_source_repos
Set the testenv setting poetry_use_source_repos to pip_env_vars to let Tox set the PIP_EXTRA_URL and PIP_EXTRA_INDEX_URL environment variables accordingly.
[testenv:example]
# ...
poetry_use_source_repos = pip_env_vars
This will read sections such as the following from the pyproject.toml file:
[[tool.poetry.source]]
name = "project-alpha"
url = "https://alpha.example/simple"
secondary = true
[[tool.poetry.source]]
name = "project-bravo"
url = "https://bravo.example/simple"
[[tool.poetry.source]]
name = "project-charlie"
url = "https://charlie.example/simple"
default = true
and set the environment variables:
PIP_INDEX_URL=https://charlie.example/simple
PIP_EXTRA_INDEX_URL=https://bravo.example/simple https://pypi.org/simple https://alpha.example/simple
If there is at least one non secondary source repository defined, then pip’s default index server (PyPI https://pypi.org/simple) is placed in PIP_EXTRA_INDEX_URL right before any secondary respository.
If pip’s environment variables are already defined then they are not overwritten. For example in a command like the following, the plugin does not overwrite the environment variable.
PIP_INDEX_URL=https://delta.example/simple tox
poetry_experimental_no_virtual_env
Experimental feature
Set the testenv setting poetry_experimental_no_virtual_env to True to skip the creation of a virtual environment for this test environment.
[testenv:real]
deps =
poetry_experimental_no_virtual_env = True
skip_install = True
This might be useful in cases where all the required dependencies and tools are already available, i.e. they are already installed in global or user site packages directory, or maybe they are already installed directly in the system (via apt, yum, pacman, etc.).
For such environments it might be best to skip the installation of the project (skip_install) as well as keeping the list of dependencies empty (deps).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tox-poetry-dev-dependencies-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea7cbeba101789162575da97700a9eeb5fdcfde5981ba3a07c3b281109f13d18 |
|
MD5 | 03c0637958cef65a6766d15d6a7c67a9 |
|
BLAKE2b-256 | 3696be463f3713943c09670d8e1477176f6e20cffa41c17b61bf62cd80c52c82 |
Hashes for tox_poetry_dev_dependencies-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ab5e7add755a0596b23e197892deebc5f221546fda038d8baed8579034949a2 |
|
MD5 | 4fc860cfb41d4cecb5f5d42661a98c97 |
|
BLAKE2b-256 | a0ebd111264cbc02952a34ad1b47155451c160bf733801cc7dfb0587674ddcae |