mirror of
https://github.com/enpaul/tox-poetry-installer.git
synced 2025-10-28 07:00:43 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e1d5fc922 | |||
| b7961bec58 | |||
| e28159060d | |||
| edcef918b3 | |||
| beba9416be |
17
README.md
17
README.md
@@ -5,15 +5,16 @@ dependencies to be installed using [Poetry](https://python-poetry.org/) using it
|
|||||||
|
|
||||||
⚠️ **This project is alpha software and should not be used in a production capacity** ⚠️
|
⚠️ **This project is alpha software and should not be used in a production capacity** ⚠️
|
||||||
|
|
||||||

|
[](https://opensource.org/licenses/MIT)
|
||||||

|
[](https://pypi.org/project/tox-poetry-installer/)
|
||||||

|
[](https://www.python.org)
|
||||||
|
[](https://github.com/psf/black)
|
||||||
|
|
||||||
**Documentation**
|
**Documentation**
|
||||||
|
|
||||||
* [Installation](#installation)
|
* [Installation](#installation)
|
||||||
* [Quick Start](#quick-start)
|
* [Quick Start](#quick-start)
|
||||||
* [Usage](#usage)
|
* [Usage Examples](#usage-examples)
|
||||||
* [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?)
|
||||||
* [Developing](#developing)
|
* [Developing](#developing)
|
||||||
@@ -97,7 +98,7 @@ commands = ...
|
|||||||
one Tox is testing) will always be installed from the lockfile.
|
one Tox is testing) will always be installed from the lockfile.
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage Examples
|
||||||
|
|
||||||
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
|
||||||
lockfile: when Tox installs your project package to one of your environments, all the dependencies
|
lockfile: when Tox installs your project package to one of your environments, all the dependencies
|
||||||
@@ -253,6 +254,12 @@ Tox installation backend using Pip.
|
|||||||
* The plugin currently depends on `poetry<1.1.0`. This can be a different version than Poetry being
|
* The plugin currently depends on `poetry<1.1.0`. This can be a different version than Poetry being
|
||||||
used for actual project development. (See the [road map](#roadmap))
|
used for actual project development. (See the [road map](#roadmap))
|
||||||
|
|
||||||
|
* Tox environments automatically inherit their settings from the main `testenv` environment. This
|
||||||
|
means that if the `require_locked_deps = true` is specified for the `testenv` environment then
|
||||||
|
all environments will also require locked dependencies. This can be overridden by explicitly
|
||||||
|
specifying `require_locked_deps = false` on child environments where unlocked dependencies are
|
||||||
|
needed.
|
||||||
|
|
||||||
* There are a handful of packages that cannot be installed from the lockfile, whether as specific
|
* There are a handful of packages that cannot be installed from the lockfile, whether as specific
|
||||||
dependencies or as transient dependencies (dependencies of dependencies). This is due to
|
dependencies or as transient dependencies (dependencies of dependencies). This is due to
|
||||||
[an ongoing discussion in the Poetry project](https://github.com/python-poetry/poetry/issues/1584);
|
[an ongoing discussion in the Poetry project](https://github.com/python-poetry/poetry/issues/1584);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "tox-poetry-installer"
|
name = "tox-poetry-installer"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
authors = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
||||||
description = "Tox plugin to install Tox environment dependencies using the Poetry backend and lockfile"
|
description = "Tox plugin to install Tox environment dependencies using the Poetry backend and lockfile"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from tox.venv import VirtualEnv as ToxVirtualEnv
|
|||||||
|
|
||||||
__title__ = "tox-poetry-installer"
|
__title__ = "tox-poetry-installer"
|
||||||
__summary__ = "Tox plugin to install Tox environment dependencies using the Poetry backend and lockfile"
|
__summary__ = "Tox plugin to install Tox environment dependencies using the Poetry backend and lockfile"
|
||||||
__version__ = "0.2.1"
|
__version__ = "0.2.2"
|
||||||
__url__ = "https://github.com/enpaul/tox-poetry-installer/"
|
__url__ = "https://github.com/enpaul/tox-poetry-installer/"
|
||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
|
||||||
@@ -266,7 +266,23 @@ def tox_testenv_install_deps(venv: ToxVirtualEnv, action: ToxAction):
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
|
try:
|
||||||
|
poetry = PoetryFactory().create_poetry(venv.envconfig.config.toxinidir)
|
||||||
|
except RuntimeError as err:
|
||||||
|
# Support running the plugin when the current tox project does not use Poetry for its
|
||||||
|
# environment/dependency management.
|
||||||
|
#
|
||||||
|
# ``RuntimeError`` is dangerous to blindly catch because it can be (and in Poetry's case,
|
||||||
|
# is) raised in many different places for different purposes. This check of the error
|
||||||
|
# content, while crude and potentially fragile, will hopefully prevent ``RuntimeError``s
|
||||||
|
# not caused by this specific condition to be re-raised as genuine errors. This may need
|
||||||
|
# tuning in the future.
|
||||||
|
if "[tool.poetry] section not found" in str(err):
|
||||||
|
reporter.verbosity1(
|
||||||
|
f"{_REPORTER_PREFIX} project does not use Poetry for env management, skipping installation of locked dependencies"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
raise err
|
||||||
|
|
||||||
reporter.verbosity1(
|
reporter.verbosity1(
|
||||||
f"{_REPORTER_PREFIX} loaded project pyproject.toml from {poetry.file}"
|
f"{_REPORTER_PREFIX} loaded project pyproject.toml from {poetry.file}"
|
||||||
|
|||||||
Reference in New Issue
Block a user