Skip to content

Commit

Permalink
chore: Update tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
mdomke committed Oct 14, 2024
1 parent 4b3aa23 commit bf3f121
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 15 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# directory via our direnv integration:

eval "$(devbox generate direnv --print-envrc)"
unset UV_PYTHON

# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# for more details
47 changes: 45 additions & 2 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,52 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Install hatch
uses: pypa/hatch@install
- name: Smoke test installation
run: pip install .

- name: Test
run: hatch test --cover --python ${{ matrix.python-version }}

- name: Disambiguate coverage filename
run: mv .coverage ".coverage.${{ matrix.os }}.${{ matrix.python-version }}"

- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: .coverage*

coverage:
runs-on: ubuntu-latest
name: Report coverage
needs:
- test
steps:
- uses: actions/checkout@v4
- name: Install Hatch
uses: pypa/hatch@install

- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true

- name: Combine coverage data
run: hatch run coverage:combine

- name: Export coverage reports
run: hatch run coverage:xml

- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.6.9
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pycqa/doc8
rev: v1.1.1
rev: v1.1.2
hooks:
- id: doc8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies:
Expand Down
8 changes: 3 additions & 5 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"packages": [
"python@3.12"
],
"packages": ["python@3.12"],
"shell": {
"init_hook": "test $FISH_VERSION && . $VENV_DIR/bin/activate.fish || . $VENV_DIR/bin/activate",
"scripts": {
"setup": [
"pip install hatch==1.9.0 pre-commit==3.7.0",
"pip install hatch==1.12.0 pre-commit==4.0.1",
"pre-commit install"
]
}
}
}
}
2 changes: 1 addition & 1 deletion devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": {
"python@3.12": {
"last_modified": "2024-05-12T16:19:40Z",
"plugin_version": "0.0.3",
"plugin_version": "0.0.4",
"resolved": "github:NixOS/nixpkgs/3281bec7174f679eabf584591e75979a258d8c40#python312",
"source": "devbox-search",
"version": "3.12.3",
Expand Down
24 changes: 20 additions & 4 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
[envs.default]
installer = "uv"
features = ["pydantic"]

[envs.hatch-static-analysis]
dependencies = ["ruff==0.6.*"]
config-path = ".ruff_defaults.toml"

[envs.hatch-test]
extra-dependencies = [
"freezegun==1.5.*",
]
features = ["pydantic"]

[envs.hatch-static-analysis]
config-path = ".ruff_defaults.toml"
[envs.coverage]
detached = true
dependencies = [
"coverage[toml]>=6.2",
"lxml",
]

[envs.coverage.scripts]
combine = "coverage combine {args}"
xml = "coverage xml"

[envs.types]
extra-dependencies = [
"mypy==1.10.*",
"mypy==1.11.*",
"pytest==8.2.*",
]
features = ["pydantic"]
scripts = { check = "mypy --install-types --non-interactive {args:schwifty tests}" }
scripts = { check = "mypy {args:schwifty tests}" }

[envs.docs]
extra-dependencies = [
Expand Down

0 comments on commit bf3f121

Please sign in to comment.