From 8f0b7c65cb401f7a4de37b9cd77bba0bbd0fd826 Mon Sep 17 00:00:00 2001 From: "David R. Reich" <43832476+SiQube@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:46:31 -0400 Subject: [PATCH] build: drop support for python 3.8 (#572) * drop python 3.8 * collections.abc.Callable instead of typing Callable --------- Co-authored-by: Daniel G. Krakowczyk --- .github/workflows/tests.yml | 5 +---- .pre-commit-config.yaml | 7 +++---- CONTRIBUTING.md | 4 ++-- pylintrc | 4 ++-- pyproject.toml | 3 +-- src/pymovements/dataset/dataset_library.py | 3 +-- src/pymovements/gaze/transforms.py | 2 +- src/pymovements/plotting/traceplot.py | 8 +++----- tox.ini | 1 - 9 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ec81c5d80..a6661d9ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,13 +19,10 @@ jobs: - ubuntu-latest - windows-latest tox_env: - - py38 - py39 - py310 - py311 include: - - tox_env: py38 - python: "3.8" - tox_env: py39 python: "3.9" - tox_env: py310 @@ -104,7 +101,7 @@ jobs: - name: Install base python for tox uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.9" - name: Install tox run: python -m pip install tox - name: Setup test environment diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 276ba0e91..0f76e7f42 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,17 +12,16 @@ repos: rev: v3.1.0 hooks: - id: add-trailing-comma - args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade rev: v3.13.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/asottile/reorder-python-imports rev: v3.11.0 hooks: - id: reorder-python-imports - args: [--application-directories=src, --py38-plus] + args: [--application-directories=src, --py39-plus] - repo: https://github.com/asottile/reorder-python-imports rev: v3.11.0 hooks: @@ -62,7 +61,7 @@ repos: - id: nbqa-isort args: ["--float-to-top"] - id: nbqa-pyupgrade - args: ["--py38-plus"] + args: ["--py39-plus"] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.5.1 hooks: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d58745069..69b5d7c20 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,9 +157,9 @@ If you add a new feature, please also include appropriate tests to verify its in functionality. We try to keep our code coverage close to 100%. It is possible to limit the scope of testing to specific environments and files. For example, to -only test event related functionality using the Python 3.8 environment use: +only test event related functionality using the Python 3.9 environment use: ```bash -tox -e py38 tests/events +tox -e py39 tests/events ``` diff --git a/pylintrc b/pylintrc index 8e4fffba2..bceefcbdb 100644 --- a/pylintrc +++ b/pylintrc @@ -54,7 +54,7 @@ unsafe-load-any-extension=no extension-pkg-allow-list= # Minimum supported python version -py-version = 3.8.0 +py-version = 3.9.0 # Control the amount of potential inferred values when inferring a single # object. This can help the performance when dealing with large functions or @@ -520,7 +520,7 @@ overgeneral-exceptions=builtins.Exception # **exclusively** for type checking of an application, you're probably fine. # For libraries, evaluate if some users what to access the type hints at # runtime first, e.g., through ``typing.get_type_hints``. Applies to Python -# versions 3.8 - 3.10 +# versions 3.9 - 3.11 runtime-typing = no diff --git a/pyproject.toml b/pyproject.toml index e5dfb8a4f..aaa474449 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta" name = "pymovements" description = "A python package for processing eye movement data" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = {text = "MIT License"} maintainers = [ {name = "Daniel Krakowczyk", email = "daniel.krakowczyk@uni-potsdam.de"} @@ -24,7 +24,6 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/src/pymovements/dataset/dataset_library.py b/src/pymovements/dataset/dataset_library.py index 8b6db508c..4e91be4ff 100644 --- a/src/pymovements/dataset/dataset_library.py +++ b/src/pymovements/dataset/dataset_library.py @@ -20,7 +20,6 @@ """DatasetLibrary module.""" from __future__ import annotations -from typing import Type from typing import TypeVar from pymovements.dataset.dataset_definition import DatasetDefinition @@ -60,7 +59,7 @@ def get(cls, name: str) -> type[DatasetDefinition]: return cls.definitions[name] -DatsetDefinitionClass = TypeVar('DatsetDefinitionClass', bound=Type[DatasetDefinition]) +DatsetDefinitionClass = TypeVar('DatsetDefinitionClass', bound=type[DatasetDefinition]) def register_dataset(cls: DatsetDefinitionClass) -> DatsetDefinitionClass: diff --git a/src/pymovements/gaze/transforms.py b/src/pymovements/gaze/transforms.py index 75f7fb779..915b61080 100644 --- a/src/pymovements/gaze/transforms.py +++ b/src/pymovements/gaze/transforms.py @@ -20,9 +20,9 @@ """Module for py:func:`pymovements.gaze.transforms.""" from __future__ import annotations +from collections.abc import Callable from functools import partial from typing import Any -from typing import Callable from typing import TypeVar import numpy as np diff --git a/src/pymovements/plotting/traceplot.py b/src/pymovements/plotting/traceplot.py index 6839f840c..10275eab3 100644 --- a/src/pymovements/plotting/traceplot.py +++ b/src/pymovements/plotting/traceplot.py @@ -21,10 +21,8 @@ from __future__ import annotations import sys -from typing import Dict +from collections.abc import Sequence from typing import Literal -from typing import Sequence -from typing import Tuple import matplotlib.colors import matplotlib.pyplot as plt @@ -42,8 +40,8 @@ if 'pytest' in sys.modules: # pragma: no cover matplotlib.use('Agg') -LinearSegmentedColormapType: TypeAlias = Dict[ - Literal['red', 'green', 'blue', 'alpha'], Sequence[Tuple[float, ...]], +LinearSegmentedColormapType: TypeAlias = dict[ + Literal['red', 'green', 'blue', 'alpha'], Sequence[tuple[float, ...]], ] DEFAULT_SEGMENTDATA: LinearSegmentedColormapType = { diff --git a/tox.ini b/tox.ini index 5e5925bf9..7f0b0cf0d 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ isolated_build = True skip_missing_interpreters = True envlist = - py38 py39 py310 py311