From 3952d18292f3e2dd47ecbf7b126f6056517ad115 Mon Sep 17 00:00:00 2001 From: jurgenwigg Date: Fri, 24 Apr 2026 18:30:31 +0200 Subject: [PATCH 1/4] initial commit --- .github/workflows/python-test.yml | 37 +++++++++++++++---------------- pyproject.toml | 19 ++++++++++++++++ tox.ini | 17 -------------- 3 files changed, 37 insertions(+), 36 deletions(-) delete mode 100644 tox.ini diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index b1605f5..310c640 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -6,23 +6,22 @@ name: Python Package Test on: [push, pull_request] jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.11", "3.12", "3.13", "3.14"] + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11", "3.12", "3.13", "3.14"] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip tox - - name: Test with tox - run: | - export py_ver=$( echo "${{ matrix.python-version }}" | sed 's/\.//') - tox -e py${py_ver} + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip hatch + - name: Test with hatch + run: | + hatch test -vacr diff --git a/pyproject.toml b/pyproject.toml index c643b88..2a9ac39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,25 @@ check = "mypy --install-types --non-interactive {args:src/codeaudit tests}" [[tool.hatch.envs.hatch-test.matrix]] python = ["3.14", "3.13", "3.12", "3.11"] +[tool.hatch.envs.hatch-test] +randomize = true +dependencies = ["pytest", "pytest-cov", "coverage"] + [tool.black] target-version = ["py311", "py312", "py313", "py314"] extend-exclude ='(python2_file_willnotwork|dunderexec_with_parsing_error).py|validationfiles|suppression|spytestdir' + +[tool.coverage.run] +branch = true +source = ["src/codeaudit"] + +[tool.coverage.report] +show_missing = true + +[tool.hatch.envs.hatch-static-analysis] +dependencies = ["black", "pylint"] + +[tool.hatch.envs.hatch-static-analysis.scripts] +format-check = "black --target-version py313 --check src tests" +format-fix = "black --target-version py313 src tests" +lint-check = "pylint src tests" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index cc68148..0000000 --- a/tox.ini +++ /dev/null @@ -1,17 +0,0 @@ -[tox] -min_version = 4.0 -env_list = py{311,312,313,314} -skip_missing_interpreters = true - -[testenv] -deps = .[test] -allowlist_externals = pytest -commands = pytest --cov codeaudit --cov-report term-missing --cov-branch -v tests - -[testenv:lint] -deps = .[test] -commands = pylint --max-line-length=88 src tests - -[testenv:formatting] -deps = .[test] -commands = black --target-version py313 --check src tests From 6e0d6a1356b442ebe5877f15b17acd6a7bb5514e Mon Sep 17 00:00:00 2001 From: jurgenwigg Date: Fri, 24 Apr 2026 18:36:03 +0200 Subject: [PATCH 2/4] simplified workflow --- .github/workflows/python-test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 310c640..5e865ea 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -8,17 +8,14 @@ on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + # this is needed only to install hatch + python-version: 3.14 - name: Install dependencies run: | python -m pip install --upgrade pip hatch From 74223f46b95902440311454c225109e36a8f45be Mon Sep 17 00:00:00 2001 From: jurgenwigg Date: Fri, 24 Apr 2026 18:39:46 +0200 Subject: [PATCH 3/4] added checking coverage --- .github/workflows/python-test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 5e865ea..bf2f793 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -6,7 +6,7 @@ name: Python Package Test on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-latest steps: @@ -22,3 +22,7 @@ jobs: - name: Test with hatch run: | hatch test -vacr + - name: Code Coverage Summary Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: .coverage From 76ce328b015093ed6ac40fa0b92844299b69768a Mon Sep 17 00:00:00 2001 From: jurgenwigg Date: Fri, 24 Apr 2026 18:52:02 +0200 Subject: [PATCH 4/4] simplified output --- .github/workflows/python-test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index bf2f793..94e080f 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -21,8 +21,4 @@ jobs: python -m pip install --upgrade pip hatch - name: Test with hatch run: | - hatch test -vacr - - name: Code Coverage Summary Report - uses: irongut/CodeCoverageSummary@v1.3.0 - with: - filename: .coverage + hatch test -acr