From 78efd82c828b00734c0a5d7453705eaf1a48703d Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Sun, 27 Sep 2020 14:51:12 -0400 Subject: [PATCH] Add quickstart section --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.md b/README.md index c47405f..d08367e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ dependencies to be installed using [Poetry](https://python-poetry.org/) using it **Documentation** * [Installation](#installation) +* [Quick Start](#quick-start) * [Usage](#usage) * [Known Drawbacks and Problems](#known-drawbacks-and-problems) * [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 ``` + +## 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 After installing the plugin to a project, your Tox automation is already benefiting from the