Skip to content

Commit

Permalink
Add support for 'tox'
Browse files Browse the repository at this point in the history
Adding 'tox' [^1] makes it possible to test xocto against multiple
versions of Python.

[^1]: https://tox.wiki/
  • Loading branch information
quicklizard99 committed Aug 12, 2024
1 parent a7b7d6a commit d3e01e9
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 5 deletions.
11 changes: 11 additions & 0 deletions docs/xocto/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ their own pull requests.
When you are ready, commit both `pyproject.toml` and
`requirements.txt`.

## tox

Run [tox](https://tox.wiki/) to test the package on supported versions
of Python.

Each versions of Python listed in `tox.ini` must be present on your
system. On Linux it is probably easiest to build each version from
source, using `make altinstall`.
If you use Mac you can install each version using homebrew e.g.,
`brew install [email protected]`.

## Publishing

### Version number
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ dev = [
"pytest",
"ruff",
"time-machine",
"tox",
"tox-uv",
"twine",
"types-openpyxl",
"types-python-dateutil",
Expand Down
41 changes: 36 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ botocore==1.29.53
# s3transfer
bytecode==0.15.1
# via ddtrace
cachetools==5.4.0
# via tox
cattrs==23.2.3
# via ddtrace
certifi==2024.7.4
Expand All @@ -35,12 +37,16 @@ cffi==1.17.0
# pact-python
cfgv==3.4.0
# via pre-commit
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via
# pact-python
# uvicorn
colorama==0.4.6
# via tox
cryptography==43.0.0
# via moto
ddsketch==3.0.1
Expand Down Expand Up @@ -70,7 +76,9 @@ exceptiongroup==1.2.2
fastapi==0.112.0
# via pact-python
filelock==3.15.4
# via virtualenv
# via
# tox
# virtualenv
h11==0.14.0
# via uvicorn
hypothesis==6.62.1
Expand Down Expand Up @@ -138,17 +146,25 @@ openpyxl==3.1.5
opentelemetry-api==1.16.0
# via ddtrace
packaging==24.1
# via pytest
# via
# pyproject-api
# pytest
# tox
# tox-uv
pact-python==2.2.1
# via xocto (pyproject.toml)
pandas==2.0.3
# via xocto (pyproject.toml)
pkginfo==1.11.1
# via twine
platformdirs==4.2.2
# via virtualenv
# via
# tox
# virtualenv
pluggy==1.5.0
# via pytest
# via
# pytest
# tox
pre-commit==3.8.0
# via xocto (pyproject.toml)
protobuf==5.27.3
Expand All @@ -171,6 +187,8 @@ pygments==2.18.0
# via
# readme-renderer
# rich
pyproject-api==1.7.1
# via tox
pytest==8.0.2
# via
# xocto (pyproject.toml)
Expand Down Expand Up @@ -242,7 +260,15 @@ time-machine==2.14.1
tomli==2.0.1
# via
# mypy
# pyproject-api
# pytest
# tox
tox==4.17.1
# via
# xocto (pyproject.toml)
# tox-uv
tox-uv==1.11.1
# via xocto (pyproject.toml)
twine==4.0.2
# via xocto (pyproject.toml)
types-openpyxl==3.0.4.5
Expand All @@ -269,6 +295,7 @@ typing-extensions==4.12.2
# pydantic
# pydantic-core
# starlette
# tox-uv
# uvicorn
tzdata==2024.1
# via pandas
Expand All @@ -278,10 +305,14 @@ urllib3==1.26.19
# requests
# responses
# twine
uv==0.2.34
# via tox-uv
uvicorn==0.30.5
# via pact-python
virtualenv==20.26.3
# via pre-commit
# via
# pre-commit
# tox
werkzeug==3.0.3
# via moto
wheel==0.38.4
Expand Down
15 changes: 15 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tox]
min_version = 4.0
envlist = py39

[testenv]
# Install wheels instead of source distributions for faster execution.
package = wheel
# Share the build environment between tox environments.
wheel_build_env = .pkg

# Run type checking because 'typing' and related packages vary among versions of Python
allowlist_externals = make
commands =
uv pip sync requirements.txt
make test mypy

0 comments on commit d3e01e9

Please sign in to comment.