Skip to content

Commit

Permalink
README.md: update installation/usage information
Browse files Browse the repository at this point in the history
Add links to tox documentation

Add section about vendoring the plugin
  • Loading branch information
masenf committed Jan 15, 2023
1 parent 42802bc commit a4fd770
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,38 @@ virtualenv for each test environment.

1. Install `tox-ignore-env-name-mismatch` in the same environment as `tox`.
2. Set `runner = ignore_env_name_mismatch` in a testenv to opt-out of recreating the virtualenv when the env name changes.
* To always use this plugin, specify `requires = tox-ignore-env-name-mismatch` in the `[tox]` section
of `tox.ini`

### To always use this plugin:

#### Install/provision

* Specify `requires = tox-ignore-env-name-mismatch~=0.2.0` in the `[tox]`
section of `tox.ini`

This will cause `tox` to provision a new virtualenv for `tox` itself and other
dependencies named in the
[`requires`](https://tox.wiki/en/latest/config.html#requires) key if the current
environment does not meet the specification.

Pinning the plugin to a minor version is _highly recommended_ to avoid breaking
changes.

#### Vendor

* copy `src/tox_ignore_env_name_mismatch.py` to the root of you project
directory as `toxfile.py`

This uses the tox4's new ["inline
plugin"](https://tox.wiki/en/latest/plugins.html#module-tox.plugin) approach
instead of relying on the provisioning system (which [can be disabled via
CLI](https://tox.wiki/en/latest/cli_interface.html#tox---no-provision)).

## Example

```
[tox]
envlist = py39,py310,py311,lint,format,types
requires = tox-ignore-env-name-mismatch
requires = tox-ignore-env-name-mismatch~=0.2.0
[testenv]
deps = pytest
Expand Down

0 comments on commit a4fd770

Please sign in to comment.