Add quickstart section

This commit is contained in:
Ethan Paul 2020-09-27 14:51:12 -04:00
parent 5476f4ab11
commit 78efd82c82
No known key found for this signature in database
GPG Key ID: D0E2CBF1245E92BF

View File

@ -12,6 +12,7 @@ dependencies to be installed using [Poetry](https://python-poetry.org/) using it
**Documentation** **Documentation**
* [Installation](#installation) * [Installation](#installation)
* [Quick Start](#quick-start)
* [Usage](#usage) * [Usage](#usage)
* [Known Drawbacks and Problems](#known-drawbacks-and-problems) * [Known Drawbacks and Problems](#known-drawbacks-and-problems)
* [Why would I use this?](#why-would-i-use-this) (What problems does this solve?) * [Why would I use this?](#why-would-i-use-this) (What problems does this solve?)
@ -53,6 +54,49 @@ same environment as Tox:
~ $: /path/to/my/automation/virtualenv/bin/pip install tox-poetry-installer ~ $: /path/to/my/automation/virtualenv/bin/pip install tox-poetry-installer
``` ```
## Quick Start
To require a Tox environment install all it's dependencies from the Poetry lockfile, add the
`require_locked_deps = true` option to the environment configuration and remove all version
specifiers from the dependency list. The versions to install will be taken from the lockfile
directly:
```ini
[testenv]
description = Run the tests
require_locked_deps = true
deps =
pytest
pytest-cov
black
pylint
mypy
commands = ...
```
To require specific dependencies be installed from the Poetry lockfile, and let the rest be
installed using the default Tox installation method, add the suffix `@poetry` to the dependencies.
In the example below the `pytest`, `pytest-cov`, and `black` dependencies will be installed using
the lockfile while `pylint` and `mypy` will be installed using the versions specified here:
```ini
[testenv]
description = Run the tests
require_locked_deps = true
deps =
pytest@poetry
pytest-cov@poetry
black@poetry
pylint >=2.5.0
mypy == 0.770
commands = ...
```
**Note:** Regardless of the settings outlined above, all dependencies of the project package (the
one Tox is testing) will always be installed from the lockfile.
## Usage ## Usage
After installing the plugin to a project, your Tox automation is already benefiting from the After installing the plugin to a project, your Tox automation is already benefiting from the