Skip to content

Commit

Permalink
Merge branch 'main' into maskSample
Browse files Browse the repository at this point in the history
  • Loading branch information
stringertheory authored Feb 5, 2024
2 parents 3a79143 + a568b17 commit e7e2b2a
Show file tree
Hide file tree
Showing 124 changed files with 704,693 additions and 2,005 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
max_line_length = 80

[*.json]
indent_style = space
indent_size = 2
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* Simplicity is better than functionality
* The API matters most, everything else is secondary
- Simplicity is better than functionality
- The API matters most, everything else is secondary

For feature requests, please include a description of why the feature
will be useful to most users.
25 changes: 25 additions & 0 deletions .github/actions/setup-poetry-env-only-main/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "setup-poetry-env"
description: "Composite action to setup the Python and poetry environment."

inputs:
python-version:
required: false
description: "The python version to use"
default: "3.12"

runs:
using: "composite"
steps:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true

- name: Install dependencies
run: poetry install --no-interaction --only main
shell: bash
33 changes: 33 additions & 0 deletions .github/actions/setup-poetry-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "setup-poetry-env"
description: "Composite action to setup the Python and poetry environment."

inputs:
python-version:
required: false
description: "The python version to use"
default: "3.12"

runs:
using: "composite"
steps:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
shell: bash
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Main

on:
push:
branches:
- main
- dev
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env

- name: Run checks
run: make check

tests-only-main-dependencies:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env-only-main

- name: just add pytest for running tests
run: poetry run python -m pip install -U pytest

- name: run the tests that don't require development dependencies
run: make test-only-main

tox:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Load cached venv
uses: actions/cache@v3
with:
path: .tox
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox

- name: Upload coverage reports to Codecov with GitHub Action on Python 3.12
uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.12' }}

check-docs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env

- name: Check if documentation can be built
# run: poetry run mkdocs build -s
run: poetry run sphinx-build docs docs/_build/html
42 changes: 42 additions & 0 deletions .github/workflows/on-release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release-main

on:
release:
types: [published]
branches: [main]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env

- name: Export tag
id: vars
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT

- name: Build and publish
run: |
source .venv/bin/activate
poetry version $RELEASE_VERSION
make build-and-publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}

deploy-docs:
needs: publish
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up the environment
uses: ./.github/actions/setup-poetry-env

- name: Deploy documentation
run: poetry run mkdocs gh-deploy --force
15 changes: 15 additions & 0 deletions .github/workflows/validate-codecov-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: validate-codecov-config

on:
pull_request:
paths: [codecov.yaml]
push:
branches: [main]

jobs:
validate-codecov-config:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Validate codecov configuration
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate
Loading

0 comments on commit e7e2b2a

Please sign in to comment.