diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cb29fa..e8a25e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ jobs: fail-fast: false matrix: python-version: - - '3.8' - - '3.12' + - '3.9' + - '3.13' name: Check Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v4 @@ -45,6 +45,8 @@ jobs: - name: Test coverage with Codecov uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} dist: runs-on: ubuntu-latest @@ -72,3 +74,14 @@ jobs: user: __token__ password: ${{ secrets.pypi_password }} if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + + pass: + if: always() + needs: [checks, dist] + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3803960..30d294d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,16 +26,14 @@ repos: rev: v2.5.0 hooks: - id: setup-cfg-fmt - args: [--include-version-classifiers, --max-py-version=3.11] + args: [--include-version-classifiers, --max-py-version=3.13] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.11.2 hooks: - # 3.9 is broken due to https://github.com/python/typeshed/pull/5216 and https://github.com/python/typeshed/pull/5214 - id: mypy - name: mypy 3.8 files: src - args: [--python-version=3.8, --show-error-codes] + args: [--show-error-codes] additional_dependencies: - types-PyYAML - types-requests diff --git a/pyproject.toml b/pyproject.toml index 6c85fa3..4e63be8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ lint.extend-ignore = [ "E501", # Line too long "PT011", # Too broad of a match ] -target-version = "py37" +target-version = "py39" lint.typing-modules = ["mypackage._compat.typing"] src = ["src"] lint.unfixable = [ diff --git a/setup.cfg b/setup.cfg index c5f2699..1670268 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,10 +17,11 @@ classifiers = Natural Language :: English Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - 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 + Programming Language :: Python :: 3.13 Programming Language :: Python :: Implementation :: CPython Typing :: Typed keywords = @@ -33,8 +34,7 @@ packages = find: install_requires = pyyaml requests - importlib-resources>=1.3;python_version<"3.9" -python_requires = >=3.8 +python_requires = >=3.9 package_dir = =src zip_safe = True @@ -49,7 +49,7 @@ console_scripts = [options.extras_require] test = - pytest>=4.0.0 + pytest>=6.0.0 pytest-cov [tool:pytest] @@ -58,7 +58,7 @@ norecursedirs = src [mypy] files = src -python_version = 3.7 +python_version = 3.9 warn_unused_configs = True disallow_any_generics = True disallow_subclassing_any = True diff --git a/src/skhep_testdata/local_files.py b/src/skhep_testdata/local_files.py index 1d50af5..58fb414 100644 --- a/src/skhep_testdata/local_files.py +++ b/src/skhep_testdata/local_files.py @@ -1,19 +1,14 @@ from __future__ import annotations -import sys import tempfile import zipfile +from importlib import resources from pathlib import Path import requests from . import data, remote_files -if sys.version_info < (3, 9): - import importlib_resources as resources # pragma: no cover -else: - from importlib import resources - __all__ = ("data_path", "download_all", "known_files") diff --git a/src/skhep_testdata/remote_files.py b/src/skhep_testdata/remote_files.py index d31ce83..7286de4 100644 --- a/src/skhep_testdata/remote_files.py +++ b/src/skhep_testdata/remote_files.py @@ -3,18 +3,13 @@ import errno import logging import os -import sys import tarfile +from importlib import resources from typing import ClassVar from urllib.request import urlretrieve import yaml -if sys.version_info < (3, 9): - import importlib_resources as resources # pragma: no cover -else: - from importlib import resources - _default_data_dir = os.path.realpath(os.path.dirname(__file__))