Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 214b920

Browse files
committed
Support Python 3.12 and drop support for 3.7
Python 3.7 is EOL.
1 parent d51b3b4 commit 214b920

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ jobs:
6767
matrix:
6868
os: [ubuntu-latest, windows-latest]
6969
python:
70-
- "3.7"
7170
- "3.8"
7271
- "3.9"
7372
- "3.10"
7473
- "3.11"
74+
- "3.12"
7575
tox_env:
7676
- pytest62
7777
- pytest62-xdist
@@ -85,6 +85,25 @@ jobs:
8585
- pytest73-xdist
8686
- pytest74
8787
- pytest74-xdist
88+
exclude:
89+
# PyTest < 7.3 uses methods that are deprecated in Python 3.12 and emits warnings that
90+
# cause the integration tests to fail.
91+
- python: "3.12"
92+
tox_env: pytest62
93+
- python: "3.12"
94+
tox_env: pytest62-xdist
95+
- python: "3.12"
96+
tox_env: pytest70
97+
- python: "3.12"
98+
tox_env: pytest70-xdist
99+
- python: "3.12"
100+
tox_env: pytest71
101+
- python: "3.12"
102+
tox_env: pytest71-xdist
103+
- python: "3.12"
104+
tox_env: pytest72
105+
- python: "3.12"
106+
tox_env: pytest72-xdist
88107

89108
steps:
90109
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["setuptools>=42"]
2+
requires = ["setuptools>=42","wheel>=0.43.0"]
33
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ classifiers =
2222
Topic :: Software Development :: Testing
2323
Programming Language :: Python
2424
Programming Language :: Python :: 3
25-
Programming Language :: Python :: 3.7
2625
Programming Language :: Python :: 3.8
2726
Programming Language :: Python :: 3.9
2827
Programming Language :: Python :: 3.10
2928
Programming Language :: Python :: 3.11
29+
Programming Language :: Python :: 3.12
3030
Programming Language :: Python :: 3 :: Only
3131
Operating System :: OS Independent
3232
License :: OSI Approved :: MIT License
@@ -36,7 +36,7 @@ package_dir=
3636
=src
3737
packages =
3838
pytest_unflakable
39-
python_requires = >=3.7
39+
python_requires = >=3.8
4040
install_requires =
4141
pytest>=6.2.0
4242
requests>=2.19.0

src/pytest_unflakable/_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import pprint
1212
import sys
1313
import time
14+
from importlib.metadata import version
1415
from typing import TYPE_CHECKING, List, Mapping, Optional
1516

16-
import pkg_resources
1717
import requests
1818
from requests import HTTPError, Response, Session
1919

@@ -27,9 +27,9 @@
2727

2828
BASE_URL = 'https://app.unflakable.com'
2929
TEST_NAME_ENTRY_MAX_LENGTH = 4096
30-
PACKAGE_VERSION = pkg_resources.get_distribution('pytest_unflakable').version
30+
PACKAGE_VERSION = version('pytest_unflakable')
3131
PLATFORM_VERSION = platform.platform()
32-
PYTEST_VERSION = pkg_resources.get_distribution('pytest').version
32+
PYTEST_VERSION = version('pytest')
3333
PYTHON_VERSION = f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}'
3434
USER_AGENT = (
3535
f'unflakable-pytest-plugin/{PACKAGE_VERSION} (PyTest {PYTEST_VERSION}; '

tests/test_unflakable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import platform
77
import re
88
import sys
9+
from importlib.metadata import version
910

10-
import pkg_resources
1111
import pytest
1212
from _pytest.config import ExitCode
1313

@@ -30,7 +30,7 @@ def _1python_version() -> None:
3030

3131
__PYTEST_MINOR_VERSION_MATCH = re.match(
3232
r'^([0-9]+\.[0-9]+)\..*$',
33-
pkg_resources.get_distribution('pytest').version,
33+
version('pytest'),
3434
)
3535
assert __PYTEST_MINOR_VERSION_MATCH is not None
3636
__PYTEST_MINOR_VERSION = __PYTEST_MINOR_VERSION_MATCH.group(1)

0 commit comments

Comments
 (0)