-
Notifications
You must be signed in to change notification settings - Fork 78
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
33 changed files
with
2,739 additions
and
2,497 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,4 @@ | ||
changes: | ||
- description: Added support for Python 3.11 | ||
type: feature | ||
pr_number: 2801 |
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ jobs: | |
- name: Python ${{ matrix.python-version }} - Setup Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Validate Changelog | ||
env: | ||
|
@@ -53,23 +53,26 @@ jobs: | |
- name: Setup Python Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Run Pre Commit | ||
uses: pre-commit/[email protected] | ||
- name: Cache pre-commit | ||
uses: actions/cache@v4 | ||
with: | ||
extra_args: --all-files | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|3.11|${{ hashFiles('.pre-commit-config.yaml') }}|${{ hashFiles('.poetry.lock') }} | ||
|
||
- name: Run pre-commit | ||
run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files | ||
|
||
- name: Run Pytest collection | ||
run: | | ||
poetry run pytest --collect-only . | ||
run: poetry run pytest --collect-only . | ||
|
||
unit-tests: | ||
name: Unit Tests / Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
fail-fast: false | ||
defaults: | ||
run: | ||
|
@@ -114,7 +117,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
fail-fast: false | ||
defaults: | ||
run: | ||
|
@@ -153,7 +156,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
python-version: ["3.8", "3.9", "3.10", "3.11"] | ||
fail-fast: false | ||
defaults: | ||
run: | ||
|
@@ -193,10 +196,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Run coverage | ||
|
@@ -240,7 +243,7 @@ jobs: | |
- name: Python ${{ matrix.python-version }} - Setup Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
working-dir: content | ||
poetry-install-arguments: "--with ci" | ||
|
||
|
@@ -362,7 +365,7 @@ jobs: | |
if: steps.files-changed.outputs.any_changed == 'true' | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Validate content master paths | ||
if: steps.files-changed.outputs.any_changed == 'true' | ||
|
@@ -381,7 +384,7 @@ jobs: | |
- name: Setup Python Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Checkout content | ||
uses: actions/checkout@v4 | ||
|
@@ -458,7 +461,7 @@ jobs: | |
- name: Setup Python Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Checkout content | ||
uses: actions/checkout@v4 | ||
|
@@ -515,7 +518,7 @@ jobs: | |
- name: Setup Python Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
|
@@ -545,7 +548,7 @@ jobs: | |
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Generate Docs | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
|
@@ -574,7 +577,7 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
cache: 'pip' | ||
|
||
- name: pip intsall current project | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Create a StrEnum class that works in both python <3.11 and >=3.11 | ||
https://tomwojcik.com/posts/2023-01-02/python-311-str-enum-breaking-change | ||
""" | ||
|
||
import sys | ||
|
||
if sys.version_info >= (3, 11): | ||
# StrEnum was added in 3.11 | ||
from enum import StrEnum as _StrEnum # type:ignore[attr-defined] | ||
from typing import Self, overload | ||
|
||
class StrEnum(_StrEnum): | ||
""" | ||
Since MyPy falsely detects usage of StrEnum as str, we patch it. See https://github.com/python/mypy/issues/14688. | ||
""" | ||
|
||
@overload | ||
def __new__(cls, object: object = ...) -> Self: | ||
... | ||
|
||
@overload | ||
def __new__( | ||
cls, object: object, encoding: str = ..., errors: str = ... | ||
) -> Self: | ||
... | ||
|
||
def __new__(cls, *values): | ||
return _StrEnum._new_member_(cls, *values) | ||
|
||
else: | ||
from enum import Enum | ||
|
||
class StrEnum(str, Enum): # type:ignore[no-redef] | ||
def __str__(self): | ||
return self |
Oops, something went wrong.