From cb72859c79f537d8c2288514665a113c1f954961 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Tue, 8 Oct 2024 11:53:59 +0100 Subject: [PATCH 1/7] Use `tox-gh` under the hood over `tox-gh-actions` Part of the `tox-dev` organisation --- .github/workflows/test.yaml | 3 +-- pyproject.toml | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 90f00510..14ad6f23 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,12 +23,11 @@ jobs: - "3.12" steps: # yamllint disable-line rule:line-length - - uses: paddyroddy/.github/actions/python/tox@cae02393710f18f5fbacd9545d1a38f0d661758e # v0 + - uses: paddyroddy/.github/actions/python/tox@2e83ccde571114eea4dacae50214fd1dff839be0 # v0 with: cache-path: |- .tox ~/.cache/sleplet - operating-system: ${{ matrix.os }} pyproject-toml: ./pyproject.toml python-version: ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 96d2056e..9efa168d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -208,16 +208,11 @@ overrides."tool.ruff.lint.isort.section-order".inline_arrays = false [tool.tox] legacy_tox_ini = """ - [gh-actions] + [gh] python = 3.11: py311 3.12: py312 - [gh-actions:env] - OS = - ubuntu-latest: linux - macos-latest: macos - [testenv] commands = pytest --cov --cov-report=lcov @@ -225,5 +220,5 @@ legacy_tox_ini = """ pytest-cov [tox] - env_list = py{310,311,312}-{linux,macos} + env_list = py{310,311,312} """ From 0731c29b3205d1b38341bf5acb74929a99794d8b Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Tue, 8 Oct 2024 12:01:55 +0100 Subject: [PATCH 2/7] Fix `env_list` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9efa168d..e53565cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -220,5 +220,5 @@ legacy_tox_ini = """ pytest-cov [tox] - env_list = py{310,311,312} + env_list = py{311,312} """ From b67f79f91aa4762de776ce71ad77225e56789c5b Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Tue, 8 Oct 2024 12:06:45 +0100 Subject: [PATCH 3/7] Move `env_list` out of legacy INI --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e53565cb..ff3a495a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -207,6 +207,10 @@ overrides."tool.coverage.paths.source".inline_arrays = false overrides."tool.ruff.lint.isort.section-order".inline_arrays = false [tool.tox] +env_list = [ + "py311", + "py312", +] legacy_tox_ini = """ [gh] python = @@ -218,7 +222,4 @@ legacy_tox_ini = """ pytest --cov --cov-report=lcov deps = pytest-cov - - [tox] - env_list = py{311,312} """ From 25884c43cef01953252dc05855ab4734bf5b301b Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Tue, 8 Oct 2024 12:23:32 +0100 Subject: [PATCH 4/7] Use `env_run_base` from TOML support --- pyproject.toml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ff3a495a..abe7baac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -205,21 +205,25 @@ write_to = "src/sleplet/_version.py" overrides."project.classifiers".inline_arrays = false overrides."tool.coverage.paths.source".inline_arrays = false overrides."tool.ruff.lint.isort.section-order".inline_arrays = false +overrides."tool.tox.env_run_base.commands".inline_arrays = false [tool.tox] env_list = [ "py311", "py312", ] -legacy_tox_ini = """ - [gh] - python = - 3.11: py311 - 3.12: py312 - - [testenv] - commands = - pytest --cov --cov-report=lcov - deps = - pytest-cov -""" +env_run_base = {commands = [ + [ + "pytest", + "--cov", + "--cov-report=lcov", + ], +], deps = [ + "pytest-cov", +]} +# legacy_tox_ini = """ +# [gh] +# python = +# 3.11: py311 +# 3.12: py312 +# """ From 8f309cb9529ca6518e0516e896bfb5e0ecb62ced Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Tue, 8 Oct 2024 12:30:27 +0100 Subject: [PATCH 5/7] Fix linting --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index abe7baac..c96d66fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -221,9 +221,10 @@ env_run_base = {commands = [ ], deps = [ "pytest-cov", ]} + # legacy_tox_ini = """ -# [gh] -# python = -# 3.11: py311 -# 3.12: py312 +# [gh] +# python = +# 3.11: py311 +# 3.12: py312 # """ From f8f02320340420e19cbae8f1946c30aad026abec Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Fri, 11 Oct 2024 10:12:28 +0100 Subject: [PATCH 6/7] Try new TOML format --- pyproject.toml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c96d66fd..b386ca57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -221,10 +221,8 @@ env_run_base = {commands = [ ], deps = [ "pytest-cov", ]} - -# legacy_tox_ini = """ -# [gh] -# python = -# 3.11: py311 -# 3.12: py312 -# """ +gh.python = {3.11 = [ + "py311", +], 3.12 = [ + "py312", +]} From c3fbfcf23523f4f7fdc7ed55943259e57a37d146 Mon Sep 17 00:00:00 2001 From: "Patrick J. Roddy" Date: Fri, 11 Oct 2024 10:15:48 +0100 Subject: [PATCH 7/7] Fix TOML syntax --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b386ca57..8d717bd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -221,8 +221,8 @@ env_run_base = {commands = [ ], deps = [ "pytest-cov", ]} -gh.python = {3.11 = [ +gh.python = {"3.11" = [ "py311", -], 3.12 = [ +], "3.12" = [ "py312", ]}