Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Latest commit

 

History

History
147 lines (110 loc) · 3.95 KB

README.md

File metadata and controls

147 lines (110 loc) · 3.95 KB

Latest version on PyPi Supported Python versions Documentation status Downloads Code style: black

tox-external-wheels

Use externally created wheels with Tox

This plugin has been merged into tox as part of version 4.0, and it will not be maintained anymore.

Migration guide

  • To use externally built packages:
[testenv]
package = external
package_env = .ext
commands =
    python -c 'from some_package import do; do()'

[testenv:.ext]
deps = build
package_glob =
    py39: {envtmpdir}{/}dist{/}*py39*.whl
    py310: {envtmpdir}{/}dist{/}*py310*.whl
commands =
    pyproject-build -w . -o {envtmpdir}{/}dist

Note that many of the original plugin's features become trivial with the new external build environments. Running a build script is just as easy as running build and installing extra dependencies is possible through deps, or by using extras.

To specify wheel file location as a command line argument, see: --installpkg.

Old usage

The rest of the README describes the usage of this plugin for people that cannot migrate to a modern tox version.

Features

  • The ability to define external wheel files to tests in the tox config (example tox.ini file):
[tox]
envlist = py-{a,b,c}
[testenv]
external_wheels =
    a: {toxinidir}/dist/*py27*.whl
    b: {toxinidir}/dist/*py37*.whl
commands =
    a,b: pytest test
    c: pip list

Or defined in a command line argument

tox -e 'py-{a,b,c}' --external_wheels 'a:dist/*py27*.whl;b:dist/*py37*.whl'

Notes: In this case py-c falls back to installing from source. tox-external_wheels now supports ! in env names

  • The ability to define an external command to build wheel(s) with (example tox.ini file):
[tox]
envlist = py-{a,b,c}
[testenv]
external_build=
    ./prepare_build.sh
    ./build.sh
external_wheels =
    {toxinidir}/dist/*.whl
commands =
    a,b: pytest test
    c: pip list

Or defined in a command line argument

tox -e 'py-{a,b,c}' --external_build './build.sh'

Note: if command exits with non-zero return code, error will be reported and exception will be raised.

  • Support installing dependencies from external wheel files by adding their name into the external_wheels in config
[tox]
envlist = py-{a,b,c}
[testenv]
deps = six
external_wheels =
    a: {toxinidir}/dist/*py27*.whl (six: six-*.whl[optional_extra])
    b: {toxinidir}/dist/*py37*.whl
commands =
    a,b: pytest test
    c: pip list

Or defined in a command line argument

tox -e 'py-{a,b,c}' --external_wheels 'a:dist/*py27*.whl (six: six-*.whl[optional_extra]);b:/dist/*py37*.whl'

Requirements

  • tox

Installation

You can install "tox-external-wheels" via pip from PyPI:

pip install tox-external-wheels

Usage

Use the external_wheel option. Like shown in usage

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, tox-external-wheels is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.