-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use [hatch](https://hatch.pypa.io/latest/) as build system * Add `pyproject.toml` and `tox.ini` linters * Add GitHub actions workflows
- Loading branch information
Showing
13 changed files
with
263 additions
and
83 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
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,69 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref | github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Test ${{ matrix.py }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
py: | ||
- "3.12" | ||
- "3.11" | ||
- "3.10" | ||
- "3.9" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup python for tox | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- run: python -m pip install tox | ||
- uses: actions/checkout@v4 | ||
- name: Setup python for test ${{ matrix.py }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: Pick environment to test | ||
shell: python | ||
run: | | ||
import codecs; import os; import sys | ||
env = "TOXENV=py{}{}\n".format(*sys.version_info[:2]) | ||
print(f"Picked:\n{env}for{sys.version}") | ||
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler: | ||
file_handler.write(env) | ||
- name: Setup test suite | ||
run: tox -vv --notest | ||
- name: Run test suite | ||
run: tox --skip-pkg-install | ||
|
||
static-typing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
- run: python -m pip install tox | ||
- name: Run mypy | ||
run: tox -e mypy | ||
|
||
lint: | ||
name: Lint | ||
uses: less-action/reusables/.github/workflows/pre-commit.yaml@main | ||
with: | ||
python-version: "3.12" | ||
|
||
check-build: | ||
name: Check packaging | ||
uses: less-action/reusables/.github/workflows/python-test-build.yaml@main |
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,11 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-publish: | ||
uses: less-action/reusables/.github/workflows/python-publish.yaml@v8 | ||
secrets: | ||
pypi_api_token: ${{ secrets.PYPI_API_TOKEN }} |
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
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
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
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
Oops, something went wrong.