Skip to content

Commit e80f9e6

Browse files
authored
Merge pull request #195 from khaeru/python-3.13
Confirm support for Python 3.13 and drop 3.8
2 parents 5256723 + 6f113ca commit e80f9e6

40 files changed

+208
-203
lines changed

.github/workflows/pytest.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
- ubuntu-latest
2323
- windows-latest
2424
python-version:
25-
- "3.8" # Earliest supported version
26-
- "3.9"
25+
- "3.9" # Earliest supported version
2726
- "3.10"
2827
- "3.11"
29-
- "3.12" # Latest supported version
28+
- "3.12"
29+
- "3.13" # Latest supported version
3030
# commented: only enable once next Python version enters RC
31-
# - "3.13.0-rc.1" # Development version
31+
# - "3.14.0-rc.1" # Development version
3232

3333
fail-fast: false
3434

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-mypy
3-
rev: v1.11.1
3+
rev: v1.12.0
44
hooks:
55
- id: mypy
66
additional_dependencies:
@@ -15,7 +15,7 @@ repos:
1515
- types-requests
1616
args: []
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.6.0
18+
rev: v0.6.9
1919
hooks:
2020
- id: ruff
2121
- id: ruff-format

doc/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Installation
44
Dependencies
55
============
66

7-
:mod:`sdmx` is a pure `Python <https://python.org>`_ package requiring Python 3.8 or higher, which can be installed:
7+
:mod:`sdmx` is a pure `Python <https://python.org>`_ package requiring Python 3.9 or higher, which can be installed:
88

99
- from `the Python website <https://www.python.org/downloads/>`_, or
1010
- using a scientific Python distribution that includes other packages useful for data analysis, such as

doc/whatsnew.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
What's new?
44
***********
55

6-
.. Next release
7-
.. ============
6+
Next release
7+
============
8+
9+
- Python 3.13 (`released 2024-10-07 <https://www.python.org/downloads/release/python-3130/>`_) is fully supported (:pull:`195`).
10+
- Python 3.8 support is dropped, as `it has reached end-of-life <https://peps.python.org/pep-0569/#lifespan>`__ (:pull:`195`).
11+
:mod:`sdmx` requires Python 3.9 or later.
812

913
v2.17.0 (2024-09-03)
1014
====================

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ classifiers = [
1919
"Operating System :: OS Independent",
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
2524
"Programming Language :: Python :: 3.11",
2625
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
2727
"Topic :: Scientific/Engineering",
2828
"Topic :: Scientific/Engineering :: Information Analysis",
2929
]
30-
requires-python = ">=3.8"
30+
requires-python = ">=3.9"
3131
dependencies = [
3232
"lxml >= 3.6",
3333
"pandas >= 1.0",
@@ -41,7 +41,6 @@ cache = ["requests-cache"]
4141
docs = ["IPython", "sphinx >=4", "sphinx-book-theme"]
4242
tests = [
4343
"Jinja2",
44-
"pyarrow", # Suppress a warning from pandas >=2.2, <3.0
4544
"pytest >= 5",
4645
"pytest-cov",
4746
"pytest-xdist",

sdmx/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22
from functools import partial
3-
from typing import IO, TYPE_CHECKING, Any, Dict, Optional, Union
3+
from typing import IO, TYPE_CHECKING, Any, Optional, Union
44
from warnings import warn
55

66
import requests
@@ -56,7 +56,7 @@ class Client:
5656
5757
"""
5858

59-
cache: Dict[str, "sdmx.message.Message"] = {}
59+
cache: dict[str, "sdmx.message.Message"] = {}
6060

6161
#: :class:`.source.Source` for requests sent from the instance.
6262
source: "sdmx.source.Source"
@@ -65,7 +65,7 @@ class Client:
6565
session: requests.Session
6666

6767
# Stored keyword arguments "allow_redirects" and "timeout" for pre-requests.
68-
_send_kwargs: Dict[str, Any] = {}
68+
_send_kwargs: dict[str, Any] = {}
6969

7070
def __init__(self, source=None, log_level=None, **session_opts):
7171
try:

sdmx/dictlike.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22
import typing
33
from dataclasses import fields
4-
from typing import Generic, Tuple, TypeVar, Union, get_args, get_origin
4+
from typing import Generic, TypeVar, Union, get_args, get_origin
55

66
log = logging.getLogger(__name__)
77

@@ -67,7 +67,7 @@ def update(self, other):
6767
def __hash__(cls):
6868
pass
6969

70-
def _validate_entry(self, kv: Tuple):
70+
def _validate_entry(self, kv: tuple):
7171
"""Validate one `key`/`value` pair."""
7272
key, value = kv
7373
try:
@@ -147,7 +147,7 @@ def _get_field_types(self, obj):
147147
self._field = next(filter(lambda f: f.name == self._name[1:], fields(obj)))
148148
# The type is DictLike[KeyType, ValueType]; retrieve those arguments
149149
kt, vt = get_args(self._field.type)
150-
# Store. If ValueType is a generic, e.g. List[int], store only List.
150+
# Store. If ValueType is a generic, e.g. list[int], store only List.
151151
self._types = (kt, get_origin(vt) or vt)
152152

153153
def __get__(self, obj, type) -> DictLike[KT, VT]:

sdmx/experimental.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def add_obs(self, observations, series_key=None):
7171

7272
@property
7373
def obs(self):
74-
# In model.DataSet, .obs is typed as List[Observation].
74+
# In model.DataSet, .obs is typed as list[Observation].
7575
# Here, the Observations are generated on request.
7676
for key, data in self._data.iterrows():
7777
yield self._make_obs(key, data)

sdmx/format/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from dataclasses import InitVar, dataclass, field
33
from enum import Enum, IntFlag
44
from functools import lru_cache
5-
from typing import List, Literal, Optional, Union
5+
from typing import Literal, Optional, Union
66

77
from sdmx.util import parse_content_type
88

@@ -141,7 +141,7 @@ def is_time_series(self) -> bool:
141141
]
142142

143143

144-
def list_media_types(**filters) -> List[MediaType]:
144+
def list_media_types(**filters) -> list[MediaType]:
145145
"""Return the string for each item in :data:`MEDIA_TYPES` matching `filters`."""
146146
result = []
147147
for mt in MEDIA_TYPES:

sdmx/format/xml/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from operator import itemgetter
77
from pathlib import Path
88
from shutil import copytree
9-
from typing import IO, Iterable, List, Mapping, Optional, Tuple, Union
9+
from typing import IO, Iterable, Mapping, Optional, Union
1010

1111
from lxml import etree
1212
from lxml.etree import QName
@@ -221,7 +221,7 @@ def _extracted_zipball(version: Version) -> Path:
221221

222222
def _handle_validate_args(
223223
schema_dir: Optional[Path], version: Union[str, Version]
224-
) -> Tuple[Path, Version]:
224+
) -> tuple[Path, Version]:
225225
"""Handle arguments for :func:`.install_schemas` and :func:`.validate_xml`."""
226226
import platformdirs
227227

@@ -274,9 +274,9 @@ def install_schemas(
274274

275275
class XMLFormat:
276276
NS: Mapping[str, Optional[str]]
277-
_class_tag: List
277+
_class_tag: list
278278

279-
def __init__(self, model, base_ns: str, class_tag: Iterable[Tuple[str, str]]):
279+
def __init__(self, model, base_ns: str, class_tag: Iterable[tuple[str, str]]):
280280
from sdmx import message # noqa: F401
281281

282282
self.base_ns = base_ns

0 commit comments

Comments
 (0)