Metadata-Version: 2.4
Name: tox-asdf-redux
Version: 0.2.1
Summary: A tox plugin using asdf to find Python executables
Keywords: tox,asdf,virtualenv
Author: Scott Sharkey
Author-email: Scott Sharkey <ssharkey@lanshark.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Framework :: tox
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Utilities
Requires-Dist: tox>=4
Requires-Dist: virtualenv>=20.21
Requires-Dist: asdf-inspect>=0.2,<0.3
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/lanshark/tox-asdf-redux
Project-URL: Repository, https://github.com/lanshark/tox-asdf-redux
Project-URL: Issues, https://github.com/lanshark/tox-asdf-redux/issues
Description-Content-Type: text/markdown

# tox-asdf-redux

A [tox][tox] plugin using [asdf][asdf] to find Python executables.

Requires tox 4 and Python 3.11+.

## Installation

Install the plugin into the same environment as tox:

```bash
uv tool install tox --with tox-asdf-redux
# or
pip install tox-asdf-redux
```

## How it works

The plugin registers two [virtualenv discovery][discovery] plugins and tells
tox to use one of them via `VIRTUALENV_DISCOVERY`. When a tox environment asks
for e.g. `py312`, `python3.12` or `3.12`, the newest matching interpreter under
`$ASDF_DATA_DIR/installs/python` is used (default `~/.asdf`; `ASDF_ROOT`
is also honoured for backward compatibility).

## Configuration

Set `asdf_discovery` per environment (or in `env_run_base` / `[testenv]`):

| value     | behaviour                                                        |
|-----------|------------------------------------------------------------------|
| `default` | use asdf interpreters, fall back to virtualenv builtin discovery |
| `strict`  | only use asdf interpreters; fail if none matches                 |
| `off`     | do not touch interpreter discovery                               |

```toml
[tool.tox.env_run_base]
asdf_discovery = "strict"
```

Note: [tox-uv][tox-uv] replaces virtualenv with `uv venv`, so this plugin has
no effect when tox-uv is installed.

## Development

```bash
uv sync
uv run pytest
uv run tox
```

Coverage (includes the tox subprocesses started by the tests):

```bash
uv run coverage run -m pytest
uv run coverage combine
uv run coverage report
```

CI combines coverage from every Python version and shows it on the workflow
run's summary page; an HTML report is attached as the `coverage-html`
artifact.
CI fails if total coverage drops below 90% (`fail_under` in `pyproject.toml`).

## Releasing

1. Bump `version` in `pyproject.toml` (`uv version --bump minor`), commit.
2. Tag and push: `git tag v0.2.0 && git push origin v0.2.0`.

The `Publish to PyPI` workflow runs CI, checks that the tag matches the project
version, builds with `uv build` and publishes using PyPI trusted publishing.

NOTE: Adapted from [tox-pyenv-redux][tox-pyenv-redux].

[tox]: https://tox.wiki/
[asdf]: https://github.com/asdf-vm/asdf
[discovery]: https://virtualenv.pypa.io/en/latest/extend.html
[tox-uv]: https://github.com/tox-dev/tox-uv
[tox-pyenv-redux]: https://github.com/un-def/tox-pyenv-redux
