Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.7, 3.8, 3.9 support #497

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v3
Expand All @@ -23,8 +23,7 @@ jobs:

- name: Install poetry
run: |
curl -sSL \
"https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py" | python
curl -sSL https://install.python-poetry.org | python3 -

# Adding `poetry` to `$PATH`:
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

We follow Semantic Versions since the `0.1.0` release.

## Version 0.5.0 (ONGOING)

- Drop `python3.7`, `python3.8` and `python3.9` support #496


## Version 0.4.1

Expand Down
7 changes: 3 additions & 4 deletions classes/_typeclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@

.. code:: python

>>> class WithField(object):
>>> class WithField:
... field: str = 'with field'

>>> assert example(WithField()) == 'with field'
Expand All @@ -123,6 +123,7 @@
Dict,
Generic,
Optional,
Protocol,
Type,
TypeVar,
Union,
Expand Down Expand Up @@ -256,7 +257,7 @@ class Supports(Generic[_AssociatedTypeDef]):

>>> from classes import typeclass, Supports

>>> class ToJson(object):
>>> class ToJson:
... ...

>>> @typeclass(ToJson)
Expand Down Expand Up @@ -609,8 +610,6 @@ def _dispatch_delegate(self, instance) -> Optional[Callable]:


if TYPE_CHECKING:
from typing_extensions import Protocol

class _TypeClassDef(Protocol[_AssociatedType]):
"""
Callable protocol to help us with typeclass definition.
Expand Down
2 changes: 1 addition & 1 deletion classes/contrib/mypy/features/supports.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@final
class VariadicGeneric(object):
class VariadicGeneric:
"""
Variadic generic support for ``Supports`` type.

Expand Down
6 changes: 3 additions & 3 deletions classes/contrib/mypy/features/typeclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


@final
class TypeClassReturnType(object):
class TypeClassReturnType:
"""
Adjust argument types when we define typeclasses via ``typeclass`` function.

Expand Down Expand Up @@ -105,7 +105,7 @@ def _process_typeclass_def_return_type(


@final
class TypeClassDefReturnType(object):
class TypeClassDefReturnType:
"""
Callback for cases like ``@typeclass(SomeType)``.

Expand Down Expand Up @@ -172,7 +172,7 @@ def instance_return_type(ctx: MethodContext) -> MypyType:


@final
class InstanceDefReturnType(object):
class InstanceDefReturnType:
"""
Class to check how instance definition is created.

Expand Down
2 changes: 1 addition & 1 deletion classes/contrib/mypy/typeops/call_signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


@final
class SmartCallSignature(object):
class SmartCallSignature:
"""
Infers the ``__call__`` signature of a typeclass.

Expand Down
2 changes: 1 addition & 1 deletion classes/contrib/mypy/typeops/mro.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@final
class MetadataInjector(object):
class MetadataInjector:
"""
Injects fake ``Supports[TypeClass]`` parent classes into ``mro``.

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/concept.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ In other words, it can fallback to more common types:
... def example(instance) -> str:
... ...

>>> class A(object):
>>> class A:
... ...

>>> class B(A):
Expand Down Expand Up @@ -505,7 +505,7 @@ to have only subtypes of some specific types during typechecking

>>> from classes import typeclass

>>> class A(object):
>>> class A:
... ...

>>> class B(A):
Expand Down
6 changes: 3 additions & 3 deletions docs/pages/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ super type to make ``len`` method available to your type:

>>> import abc

>>> class HasLength(object):
>>> class HasLength:
... @abc.abstractmethod
... def len(self) -> int:
... """You have to implement this method to get the length."""
Expand Down Expand Up @@ -96,7 +96,7 @@ For example, imagine you have a typical domain ``Person`` class:

>>> from typing import Sequence

>>> class Person(object):
>>> class Person:
... def become_friends(self, friend: 'Person') -> None:
... ...
...
Expand All @@ -111,7 +111,7 @@ And our library requires this extra API:

.. code:: diff

--- class Person(object):
--- class Person:
+++ class Person(JSONSerializable):

+++ def to_json(self) -> str:
Expand Down
Loading
Loading