Skip to content

Commit

Permalink
Merge pull request #41 from BrianPugh/py312
Browse files Browse the repository at this point in the history
Add python 3.12 to CI tests
  • Loading branch information
BrianPugh authored Oct 24, 2023
2 parents d1739ab + a0fdbfd commit 4c061ee
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 17 deletions.
62 changes: 56 additions & 6 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Build package and push to PyPi

on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
Expand All @@ -8,10 +10,58 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/[email protected]
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Includes getting tags

- name: Cache $HOME/.local # Significantly speeds up Poetry Install
uses: actions/cache@v3
with:
path: ~/.local
key: dotlocal-${{ runner.os }}-${{ hashFiles('.github/workflows/deploy.yml') }}

- name: Set up python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"

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

- name: Add Poetry Plugins
run: |
poetry self add poetry-dynamic-versioning[plugin]
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --without=dev

- name: Install project
run: poetry install --no-interaction --without=dev

- name: Build package
run: poetry build

- name: Publish package
if: github.event_name != 'workflow_dispatch'
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
- uses: actions/upload-artifact@v3
if: always()
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
ignore_dev_requirements: "yes"
plugins: "poetry-dynamic-versioning[plugin]"
name: dist
path: dist/
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.277"
rev: "v0.1.1"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
args: ["-L", "ClassE,classe"]

- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.10.1
hooks:
- id: black
args:
Expand All @@ -24,12 +24,12 @@ repos:
exclude: ^typesafety/

- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-ast
Expand All @@ -55,7 +55,7 @@ repos:
exclude: \.(html|svg)$

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.316
rev: v1.1.332
hooks:
- id: pyright
exclude: ^typesafety/
4 changes: 2 additions & 2 deletions tests/test_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Pikachu(Pokemon):


def test_abc_multiple_inheritence_first():
"""The programmer doesn't know inheritting from ABC is superfluous."""
"""The programmer doesn't know inheriting from ABC is superfluous."""

class Pokemon(ABC, Registry):
@abstractmethod
Expand All @@ -58,7 +58,7 @@ class Pikachu(Pokemon):


def test_abc_multiple_inheritence_last():
"""The programmer doesn't know inheritting from ABC is superfluous."""
"""The programmer doesn't know inheriting from ABC is superfluous."""

class Pokemon(Registry, ABC):
@abstractmethod
Expand Down
4 changes: 2 additions & 2 deletions tests/test_meta_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_extended_registry():
foo = Foo()
bar = Bar()

assert foo.extended_attribute == "Foo"
assert bar.extended_attribute == "Bar"
assert foo.extended_attribute == "Foo" # pyright: ignore[reportGeneralTypeIssues]
assert bar.extended_attribute == "Bar" # pyright: ignore[reportGeneralTypeIssues]

assert list(Foo) == ["bar"]

0 comments on commit 4c061ee

Please sign in to comment.