diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 2f63a626..79a3ac5b 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -33,4 +33,4 @@ jobs: run: sudo apt-get install -y libsecp256k1-dev - name: Run Hatch lint - run: hatch run lint:all + run: hatch run linting:all diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 836a5175..1c42ce1c 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -22,9 +22,9 @@ jobs: python-version: ${{ matrix.python-version }} - run: sudo apt-get install -y python3-pip libsecp256k1-dev - run: python -m pip install --upgrade pip hatch - - run: hatch run test:run + - run: hatch run testing:test if: matrix.python-version != '3.11' - - run: hatch run test:run-coverage-report + - run: hatch run testing:cov if: matrix.python-version == '3.11' - uses: codecov/codecov-action@v4.0.1 if: matrix.python-version == '3.11' diff --git a/pyproject.toml b/pyproject.toml index e5b1666e..ac95b8bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,9 @@ include = [ [tool.isort] profile = "black" +[[tool.hatch.envs.all.matrix]] +python = ["3.8", "3.9", "3.10", "3.11"] + [tool.hatch.envs.test] features = [ "cosmos", @@ -125,19 +128,19 @@ dependencies = [ "httpx", "secp256k1", ] -[tool.hatch.envs.test.scripts] -run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov=tests" -run = "pytest {args:.}" -run-coverage-report = [ - "run-coverage", - "- coverage combine", - "coverage report", +[tool.hatch.envs.testing.scripts] +test = "pytest {args:tests}" +test-cov = "pytest --cov {args:tests}" +cov-report = [ + "- coverage combine", + "coverage report", +] +cov = [ + "test-cov", + "cov-report", ] -[[tool.hatch.envs.all.matrix]] -python = ["3.8", "3.9", "3.10", "3.11"] - -[tool.hatch.envs.lint] +[tool.hatch.envs.linting] detached = true dependencies = [ "black==24.2.0", @@ -146,7 +149,7 @@ dependencies = [ # "ruff==0.1.15", "isort==5.13.2", ] -[tool.hatch.envs.lint.scripts] +[tool.hatch.envs.linting.scripts] typing = "mypy --config-file=pyproject.toml {args:} ./src/ ./tests/ ./examples/" style = [ # "ruff {args:.}",