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

chore: drop python 3.8 and test 3.13 #163

Merged
merged 8 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
ariostas marked this conversation as resolved.
Show resolved Hide resolved
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) }}
6 changes: 2 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
Expand All @@ -49,7 +49,7 @@ console_scripts =

[options.extras_require]
test =
pytest>=4.0.0
pytest>=6.0.0
pytest-cov

[tool:pytest]
Expand All @@ -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
Expand Down
7 changes: 1 addition & 6 deletions src/skhep_testdata/local_files.py
Original file line number Diff line number Diff line change
@@ -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")


Expand Down
7 changes: 1 addition & 6 deletions src/skhep_testdata/remote_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))


Expand Down