Skip to content

Commit

Permalink
switch to legacy_tox_ini, remove tox-ini-fmt.
Browse files Browse the repository at this point in the history
I noticed tox-dev/tox-ini-fmt#42, which makes
it hard to use comments in tox.ini. Auto-formatting tox.ini was the main
motivation to use a separate tox.ini at all, so just keep everything in
pyproject.toml.

Maybe tox will eventually have first-party support for pyproject.toml;
this will make the transition that much simpler.

It appears that tox==3.21.4 (appears on on ubuntu-22.04) can't actually
parse the legacy_tox_ini option, and so does not get to the point of
provisioning a tox environment for the approrpiate version. We now do
proper provisioning ourselves in github ci.
  • Loading branch information
sbrudenell committed Jun 25, 2024
1 parent af4f50d commit 53d58d2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ jobs:
- uses: actions/checkout@v4
- run: |
sudo apt update
sudo apt install python3-btrfsutil tox
- run: |
sudo tox
sudo apt install python3-btrfsutil python3-virtualenv
python3 -m virtualenv /tmp/venv
source /tmp/venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade tox
sudo -E env PATH=$PATH tox
pre-commit:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ repos:
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
- id: tox-ini-fmt
- repo: https://github.com/google/yamlfmt
rev: v0.12.1
hooks:
Expand Down
30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,36 @@ lint.isort.force-sort-within-sections = true
lint.isort.order-by-type = false
lint.pydocstyle.convention = "google"

[tool.coverage.run]
plugins = [
"covdefaults",
]
source = [
"btrfs2s3",
"tests",
]

[tool.tox]
legacy_tox_ini = """
[tox]
requires =
tox>=4.2
env_list =
py
[testenv]
system_site_packages = true
deps =
covdefaults
coverage
moto[s3]
pytest
commands =
coverage erase
coverage run -m pytest {posargs}
coverage report
"""

[tool.mypy]
mypy_path = "typeshed"
strict = true
23 changes: 0 additions & 23 deletions tox.ini

This file was deleted.

0 comments on commit 53d58d2

Please sign in to comment.