Skip to content

Commit ddf4d03

Browse files
committed
chore: drop support for Python 3.7 and 3.8
Test against supported versions of PyPy: 3.10 and 3.11
1 parent e838656 commit ddf4d03

File tree

14 files changed

+20
-90
lines changed

14 files changed

+20
-90
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ jobs:
1111
strategy:
1212
matrix:
1313
python:
14-
- "3.7"
15-
- "3.8"
1614
- "3.9"
1715
- "3.10"
1816
- "3.11"
19-
- "pypy-3.7"
20-
- "pypy-3.8"
21-
- "pypy-3.9"
17+
- "pypy-3.10"
18+
- "pypy-3.11"
2219
steps:
2320
- uses: actions/checkout@v5
2421
- name: Setup Python ${{ matrix.python }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ adheres to [Semantic Versioning](https://semver.org/).
99

1010
[unreleased]: https://github.com/rogdham/python-xz/compare/v0.5.0...HEAD
1111

12+
### :boom: Breaking changes
13+
14+
- End of Python 3.7 and 3.8 support
15+
1216
### :house: Internal
1317

1418
- Freeze dev dependencies versions
1519
- Update GitHub actions dependencies
20+
- Add tests for PyPy 3.10 and 3.11
1621

1722
## [0.5.0] - 2023-02-27
1823

pytest.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ addopts =
44
--strict-markers
55
filterwarnings =
66
error
7-
# issue in standard lib for PyPy < 3.9
8-
ignore:Using or importing the ABCs from 'collections':DeprecationWarning:_lzma
97
markers =
108
generate_integration_files
119
integration

setup.cfg

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ classifiers =
1919
Programming Language :: Python
2020
Programming Language :: Python :: 3
2121
Programming Language :: Python :: 3 :: Only
22-
Programming Language :: Python :: 3.7
23-
Programming Language :: Python :: 3.8
2422
Programming Language :: Python :: 3.9
2523
Programming Language :: Python :: 3.10
2624
Programming Language :: Python :: 3.11
@@ -32,9 +30,7 @@ classifiers =
3230
include_package_data = True
3331
package_dir = =src
3432
packages = xz
35-
python_requires = >=3.7
33+
python_requires = >=3.9
3634
setup_requires =
3735
setuptools_scm
3836
wheel
39-
install_requires =
40-
typing-extensions>=4.5.0;python_version<"3.8"

src/xz/typing.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1+
from collections.abc import Mapping, Sequence
12
from os import PathLike
2-
import sys
3-
from typing import TYPE_CHECKING, Any, BinaryIO, Optional, Union
3+
from typing import TYPE_CHECKING, Any, BinaryIO, Literal, Optional, Protocol, Union
44

5-
if sys.version_info >= (3, 9): # pragma: no cover
6-
from collections.abc import Mapping, Sequence
7-
8-
_LZMAFilenameType = Union[str, bytes, PathLike[str], PathLike[bytes], BinaryIO]
9-
else: # pragma: no cover
10-
from typing import Mapping, Sequence
11-
12-
_LZMAFilenameType = Union[str, bytes, PathLike, BinaryIO]
13-
14-
15-
if sys.version_info >= (3, 8): # pragma: no cover
16-
from typing import Literal, Protocol
17-
else: # pragma: no cover
18-
from typing_extensions import Literal, Protocol
5+
_LZMAFilenameType = Union[str, bytes, PathLike[str], PathLike[bytes], BinaryIO]
196

207

218
if TYPE_CHECKING: # pragma: no cover

src/xz/utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
from bisect import bisect_right, insort_right
2-
import sys
2+
from collections.abc import Iterator, MutableMapping
33
from typing import Any, Dict, Generic, List, Tuple, TypeVar, cast
44

5-
if sys.version_info >= (3, 9): # pragma: no cover
6-
from collections.abc import Iterator, MutableMapping
7-
else: # pragma: no cover
8-
from typing import Iterator, MutableMapping
9-
10-
115
T = TypeVar("T")
126

137

tests/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1+
from collections.abc import Callable, Iterator
12
from itertools import chain, product
23
from pathlib import Path
3-
import sys
44
from typing import List, Tuple
55

66
import pytest
77

8-
if sys.version_info >= (3, 9): # pragma: no cover
9-
from collections.abc import Callable, Iterator
10-
else: # pragma: no cover
11-
from typing import Callable, Iterator
12-
138

149
def pytest_addoption(parser: pytest.Parser) -> None:
1510
parser.addoption(

tests/integration/test_ram_usage.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
from collections.abc import Callable, Iterator
12
from io import DEFAULT_BUFFER_SIZE
23
from lzma import compress
34
from pathlib import Path
4-
from random import seed
5-
import sys
5+
from random import randbytes, seed
66
from typing import BinaryIO, Optional, cast
77

88
import pytest
@@ -11,16 +11,6 @@
1111
from xz.common import create_xz_index_footer, parse_xz_footer, parse_xz_index
1212
from xz.io import IOCombiner, IOStatic
1313

14-
if sys.version_info >= (3, 9):
15-
from collections.abc import Callable, Iterator
16-
from random import randbytes
17-
else:
18-
from random import getrandbits
19-
from typing import Callable, Iterator
20-
21-
def randbytes(length: int) -> bytes:
22-
return getrandbits(length * 8).to_bytes(length, "little")
23-
2414

2515
@pytest.fixture
2616
def ram_usage() -> Iterator[Callable[[], int]]:

tests/integration/test_readme.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1+
from collections.abc import Iterator
12
import doctest
23
import os
34
from pathlib import Path
45
import shutil
5-
import sys
66
from typing import List, Optional, Tuple
77

88
import pytest
99

1010
import xz
1111

12-
if sys.version_info >= (3, 9): # pragma: no cover
13-
from collections.abc import Iterator
14-
else: # pragma: no cover
15-
from typing import Iterator
16-
1712

1813
@pytest.fixture(autouse=True)
1914
def change_dir(tmp_path: Path) -> Iterator[None]:

tests/unit/test_block.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Callable, Iterator
12
from io import SEEK_SET, BytesIO, UnsupportedOperation
2-
import sys
33
from typing import Tuple, cast
44
from unittest.mock import Mock, call
55

@@ -10,12 +10,6 @@
1010
from xz.common import XZError, create_xz_header, create_xz_index_footer
1111
from xz.io import IOAbstract, IOStatic
1212

13-
if sys.version_info >= (3, 9): # pragma: no cover
14-
from collections.abc import Callable, Iterator
15-
else: # pragma: no cover
16-
from typing import Callable, Iterator
17-
18-
1913
BLOCK_BYTES = bytes.fromhex(
2014
"0200210116000000742fe5a3e0006300415d00209842100431d01ab285328305"
2115
"7ddb5924a128599cc9911a7fcff8d59c1f6f887bcee97b1f83f1808f005de273"

0 commit comments

Comments
 (0)