diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index b1605f5..94e080f 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -6,23 +6,19 @@ 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"] + test: + runs-on: ubuntu-latest - 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: + # this is needed only to install hatch + python-version: 3.14 + - name: Install dependencies + run: | + python -m pip install --upgrade pip hatch + - name: Test with hatch + run: | + hatch test -acr 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