Skip to content

Commit

Permalink
Merge pull request #124 from ariebovenberg/release-1.1
Browse files Browse the repository at this point in the history
🐍 Official Python 3.12 support, drop 3.7
  • Loading branch information
ariebovenberg committed Dec 7, 2023
2 parents bd4f6dd + 26cd0ce commit 45ef56e
Show file tree
Hide file tree
Showing 9 changed files with 332 additions and 394 deletions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Please use the following checklist (insofar applicable)
to make sure you didn't miss anything.
-->

- [ ] Issue refereced
- [ ] Issue referenced
- [ ] Tests added
- [ ] Build OK
- [ ] Added changelog entry (section 'next release')
- [ ] Bumped version in `pyproject.toml`
- [ ] Merge PR
- [ ] Delete branch
- [ ] Add tag
- [ ] Add GitHub release
- [ ] Publish to PyPI
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v1
Expand All @@ -25,6 +25,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions poetry==1.3.2
pip install "tox<5" tox-gh-actions "poetry<1.8"
- name: Test with tox
run: tox
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Changelog
Next release
------------

1.1.0 (2023-12-07)
------------------

- 🐍 Add official Python 3.12 support, drop Python 3.7 support.
- 🗑️ No dependencies anymore!

1.0.0 (2023-02-03)
------------------

Expand Down
673 changes: 306 additions & 367 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "quacks"
version = "1.0.0"
version = "1.1.0"
description = "Better duck-typing with mypy-compatible extensions to Protocol"
authors = ["Arie Bovenberg <a.c.bovenberg@gmail.com>"]
license = "MIT"
Expand All @@ -19,26 +19,24 @@ keywords = [
classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[tool.poetry.dependencies]
python = "^3.7.0"
importlib-metadata = {version = ">=4", python = "<3.8"}
typing-extensions = ">3.7,<5"
python = "^3.8.1"

[tool.poetry.dev-dependencies]
pytest = "^7.4.3"
black = "^23.3.0"
mypy = "^1.4"
pytest-mypy-plugins = "^2.0.0"
mypy = "^1.7"
pytest-mypy-plugins = "^3.0.0"
isort = "^5.11.5"
pytest-cov = "^4.1.0"
flake8 = "^5.0.4"
flake8 = "^6"

[tool.black]
line-length = 79
Expand Down
9 changes: 2 additions & 7 deletions src/quacks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
from typing import _GenericAlias # type: ignore
from typing import TYPE_CHECKING, ClassVar

from typing_extensions import Protocol
from typing import TYPE_CHECKING, ClassVar, Protocol

# Single-sourcing the version number with poetry:
# https://github.com/python-poetry/poetry/pull/2366#issuecomment-652418094
try:
__version__ = __import__("importlib.metadata").metadata.version(__name__)
except ModuleNotFoundError: # pragma: no cover
__version__ = __import__("importlib_metadata").version(__name__)
__version__ = __import__("importlib.metadata").metadata.version(__name__)


__all__ = ["readonly"]
Expand Down
3 changes: 1 addition & 2 deletions tests/test_readonly.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import ClassVar
from typing import ClassVar, Protocol

import pytest
from typing_extensions import Protocol

from quacks import readonly

Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = true
envlist = py{37,38,39,310,311},lint,docs,isort
envlist = py{38,39,310,311,312},lint,docs,isort
[testenv]
allowlist_externals =
poetry
Expand Down Expand Up @@ -39,8 +39,8 @@ exclude_lines=

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311, lint, isort, docs
3.11: py311
3.12: py312, lint, isort, docs
8 changes: 4 additions & 4 deletions typesafety/test_readonly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- case: default_value_not_supported_yet
main: |
from quacks import readonly
from typing_extensions import Protocol
from typing import Protocol
@readonly
class A(Protocol):
Expand All @@ -21,7 +21,7 @@
- case: satisfy_protocol
main: |
from typing import ClassVar
from typing_extensions import Protocol
from typing import Protocol
from quacks import readonly
from dataclasses import dataclass
from datetime import date
Expand Down Expand Up @@ -66,7 +66,7 @@
- case: failure_to_satisfy_protocol
main: |
from typing import ClassVar
from typing_extensions import Protocol
from typing import Protocol
from quacks import readonly
from dataclasses import dataclass
from datetime import date
Expand Down Expand Up @@ -110,7 +110,7 @@
- case: complex_typing
main: |
from typing import ClassVar, TypeVar
from typing_extensions import Protocol
from typing import Protocol
from quacks import readonly
from dataclasses import dataclass
from datetime import date
Expand Down

0 comments on commit 45ef56e

Please sign in to comment.