-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
82 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,51 +12,27 @@ jobs: | |
tests: | ||
name: Run tests | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11"] | ||
os: ["ubuntu-latest"] | ||
|
||
runs-on: ${{ matrix.os }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Installing via `pipx` is 'fully supported', so no need for | ||
# https://github.com/snok/install-poetry, which is a bit slower. See also | ||
# https://python-poetry.org/docs/master/#installing-with-pipx | ||
- name: Install Poetry | ||
run: pipx install poetry | ||
|
||
# Counterintuitively, the Python setup step itself is setup *after* installing | ||
# `poetry`, else the `poetry` command isn't found and the setup step fails. See | ||
# also: | ||
# https://github.com/marketplace/actions/setup-python#caching-packages-dependencies | ||
- uses: actions/setup-python@v4 | ||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: poetry | ||
|
||
- name: Set up Python environment | ||
# `poetry env use` instructs all `poetry` runs to go through the correct (NOT | ||
# the default aka system) Python environment, see also: | ||
# https://github.com/actions/setup-python/issues/374#issuecomment-1088938718 | ||
# As long as we then call all actions via `poetry run ...`, we're fine. | ||
run: | | ||
poetry env use ${{ matrix.python-version }} | ||
poetry install | ||
enable-cache: true | ||
|
||
- name: Run linting | ||
run: make lint | ||
run: devbox run lint | ||
|
||
- name: Check code formatting | ||
run: make formatcheck | ||
run: devbox run formatcheck | ||
|
||
- name: Run type checks | ||
run: make typecheck | ||
run: devbox run typecheck | ||
|
||
- name: Run tests | ||
run: make test | ||
run: devbox run test | ||
env: | ||
# Unit tests actually run against the GH API for 'real integration testing', | ||
# and providing a token will increase the otherwise too-low rate limit. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"packages": [ | ||
"python@3", | ||
"[email protected]", | ||
"graphviz@8", | ||
"pre-commit@3" | ||
], | ||
"env": { | ||
"LIBRARY": "ancv" | ||
}, | ||
"shell": { | ||
"init_hook": [ | ||
"echo 'Running command in devbox shell...'", | ||
"poetry install" | ||
], | ||
"scripts": { | ||
"build-image": "docker build --progress=plain --tag ${LIBRARY}/${LIBRARY} .", | ||
"format-check": "poetry run black --check --diff \"LIBRARY\"", | ||
"install-hooks": "pre-commit install --hook-type pre-push --hook-type pre-commit --hook-type commit-msg", | ||
"lint": "poetry run ruff .", | ||
"make-depgraph.svg": "poetry run pydeps --max-bacon=4 --cluster -T svg -o depgraph.svg \"$LIBRARY\"", | ||
"make-github.py": "poetry run datamodel-codegen --url \"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions-next/api.github.com/dereferenced/api.github.com.deref.json\" --encoding utf-8 --input-file-type openapi --openapi-scopes paths --output github.py", | ||
"make-resume.py": "poetry run datamodel-codegen --url \"https://raw.githubusercontent.com/jsonresume/resume-schema/master/schema.json\" --encoding utf-8 --input-file-type jsonschema --output resume.py", | ||
"test": "poetry run pytest --cov=\"LIBRARY\" --cov-report=html --cov-report=term --cov-report=xml", | ||
"typecheck": "poetry run mypy -p \"$LIBRARY\"" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"lockfile_version": "1", | ||
"packages": { | ||
"graphviz@8": { | ||
"last_modified": "2023-07-23T03:35:12Z", | ||
"resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#graphviz", | ||
"source": "devbox-search", | ||
"version": "8.0.5" | ||
}, | ||
"[email protected]": { | ||
"last_modified": "2023-07-23T03:35:12Z", | ||
"resolved": "github:NixOS/nixpkgs/af8cd5ded7735ca1df1a1174864daab75feeb64a#poetry", | ||
"source": "devbox-search", | ||
"version": "1.5.1" | ||
}, | ||
"pre-commit@3": { | ||
"last_modified": "2023-06-30T04:44:22Z", | ||
"resolved": "github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb#pre-commit", | ||
"source": "devbox-search", | ||
"version": "3.3.3" | ||
}, | ||
"python@3": { | ||
"last_modified": "2023-07-30T12:29:02Z", | ||
"plugin_version": "0.0.1", | ||
"resolved": "github:NixOS/nixpkgs/3acb5c4264c490e7714d503c7166a3fde0c51324#python312", | ||
"source": "devbox-search", | ||
"version": "3.12.0b4" | ||
} | ||
} | ||
} |