diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..f0b09f8 --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,45 @@ +name: qa + +on: + push: + branches: + - main + pull_request: + +jobs: + lint-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: "3.9" + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: + pre-commit-3|${{ env.pythonLocation }}|${{ + hashFiles('.pre-commit-config.yaml') }} + - uses: abatilo/actions-poetry@v2 + - run: python -m pip install pre-commit + - run: poetry install + - run: + poetry run pre-commit run --show-diff-on-failure --color=always --all + test: + needs: lint-format + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python_version: ["3.9", "3.10", "3.11", "3.12"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_version }} + - uses: abatilo/actions-poetry@v2 + - run: python -m pip install tox-gh>=1.2 + - run: poetry install --no-root && poetry run tox diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2d98d52 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: qa + +on: + push: + tags: + - v* + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: "3.9" + - uses: abatilo/actions-poetry@v2 + - run: git fetch origin gh-pages --depth=1 + - run: poetry install --with docs + - run: poetry run mike deploy ${{ github.ref_name }} stable + + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_version }} + - uses: abatilo/actions-poetry@v2 + - run: poetry build + - run: poetry publish --dry-run + - run: poetry publish diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b33fae..ddd77c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,28 +1,29 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace -- repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" - hooks: - - id: prettier - args: [--prose-wrap, always] - types_or: [ markdown ] + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.1.0" + hooks: + - id: prettier + args: [--prose-wrap, always] + types_or: [markdown, yaml] -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.3 - hooks: - - id: ruff - args: [ --fix ] - - id: ruff-format + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.3 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format -- repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.354 - hooks: - - id: pyright - language: system - types: [python] + - repo: local + hooks: + - id: pyright + name: pyright + entry: pyright + language: system + types: [python] diff --git a/mkdocs.yml b/mkdocs.yml index 6556891..519d632 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,7 +21,6 @@ plugins: - search - social - markdown_extensions: - pymdownx.superfences - pymdownx.highlight: diff --git a/pyproject.toml b/pyproject.toml index 02298a3..ca15221 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,12 +50,19 @@ legacy_tox_ini = """ min_version = 4.0 env_list = py{39,310,311,312} + [gh] + python = + 3.12 = py312 + 3.11 = py311 + 3.10 = py310 + 3.9 = py39 + [testenv] description = run the tests with pytest allowlist_externals = poetry commands_pre = - poetry install + poetry install --no-root commands = pytest tests """