tox-extras
A tox plugin to install extras directly from pyproject.toml into a testenv
Quick start
Install it with
pip install tox-extras
Add it to requires in the [tox] section of your tox.ini
[tox]
min_version = 4.0
requires = tox-extras
Say you have a lint extra in pyproject.toml which you want to use in a
testenv:
[project.optional-dependencies]
lint = ["black==23.3.0"]
In your tox.ini testenv sections you can write
[testenv:lintonly]
skip_sdist = true
skip_install = true
tox_extras = lint
commands = black --check example.py
and this will install all deps from the "lint" extra into the testenv without installing your package or any of its deps.
Motivation
Tox has built-in support for installing extras using the extras testenv config
option, but this does not work when combined with skip_install.
This plugin adds a tox_extras option to the tox EnvConfigSet and installs
the extras named in this option into the testenv directly from pyproject.toml
without installing the package.
This would be especially valuable when we want to use pyproject.toml as a
single source of truth for our build, install, and dev dependencies (so putting
deps in tox.ini is out of the question), but at the same time we don't want
to "waste time" building and installing our package (and maybe its deps in a
first-time tox run, e.g., in CI) into a testenv that only runs a linter (and
therefore does not depend at all on the package or any deps being installed).
See https://github.com/tox-dev/tox/issues/2301 for the corresponding feature request in tox.
See https://github.com/pypa/pip/issues/4783#issuecomment-343771222 for commentary about the possible advantages of keeping all dependencies in one place.
Limitations
This plugin explicitly parses pyproject.toml, so it will not work with
projects that define extras in setup.py.
Metadata
Release files for tox-extras 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tox-extras-0.0.2.tar.gz | 5.8 kB | Without provenance | Details for tox-extras-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tox_extras-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for tox_extras-0.0.2-py3-none-any.whl |
Total release size: 10.1 kB
Release files / tox-extras-0.0.2.tar.gz
| Download URL | tox-extras-0.0.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4461d5614344c2db72daf69bd6488b1ebeb8bb858506fcb43318ab3b0b1fc458
|
|
BLAKE2b-256 checksum How to use checksums |
265f3ee0c8a398dc064024605d80c15689bb3bb6cc15db7505ab438a4d9355ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / tox_extras-0.0.2-py3-none-any.whl
| Download URL | tox_extras-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2731d5a482bd904f4502d78008607f80d5d8217b75763f3614eea53072910864
|
|
BLAKE2b-256 checksum How to use checksums |
3921a9c12999e630a28062565daf43dec4e053b08083e5d853ae70ce956a4fc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for tox-extras 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.