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

Commit

Permalink
Support Python 3.12 and drop support for 3.7
Browse files Browse the repository at this point in the history
Python 3.7 is EOL.
  • Loading branch information
ramosbugs committed Apr 30, 2024
1 parent d51b3b4 commit 214b920
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
tox_env:
- pytest62
- pytest62-xdist
Expand All @@ -85,6 +85,25 @@ jobs:
- pytest73-xdist
- pytest74
- pytest74-xdist
exclude:
# PyTest < 7.3 uses methods that are deprecated in Python 3.12 and emits warnings that
# cause the integration tests to fail.
- python: "3.12"
tox_env: pytest62
- python: "3.12"
tox_env: pytest62-xdist
- python: "3.12"
tox_env: pytest70
- python: "3.12"
tox_env: pytest70-xdist
- python: "3.12"
tox_env: pytest71
- python: "3.12"
tox_env: pytest71-xdist
- python: "3.12"
tox_env: pytest72
- python: "3.12"
tox_env: pytest72-xdist

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=42"]
requires = ["setuptools>=42","wheel>=0.43.0"]
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ classifiers =
Topic :: Software Development :: Testing
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
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 :: Only
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Expand All @@ -36,7 +36,7 @@ package_dir=
=src
packages =
pytest_unflakable
python_requires = >=3.7
python_requires = >=3.8
install_requires =
pytest>=6.2.0
requests>=2.19.0
Expand Down
6 changes: 3 additions & 3 deletions src/pytest_unflakable/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import pprint
import sys
import time
from importlib.metadata import version
from typing import TYPE_CHECKING, List, Mapping, Optional

import pkg_resources
import requests
from requests import HTTPError, Response, Session

Expand All @@ -27,9 +27,9 @@

BASE_URL = 'https://app.unflakable.com'
TEST_NAME_ENTRY_MAX_LENGTH = 4096
PACKAGE_VERSION = pkg_resources.get_distribution('pytest_unflakable').version
PACKAGE_VERSION = version('pytest_unflakable')
PLATFORM_VERSION = platform.platform()
PYTEST_VERSION = pkg_resources.get_distribution('pytest').version
PYTEST_VERSION = version('pytest')
PYTHON_VERSION = f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}'
USER_AGENT = (
f'unflakable-pytest-plugin/{PACKAGE_VERSION} (PyTest {PYTEST_VERSION}; '
Expand Down
4 changes: 2 additions & 2 deletions tests/test_unflakable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import platform
import re
import sys
from importlib.metadata import version

import pkg_resources
import pytest
from _pytest.config import ExitCode

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

__PYTEST_MINOR_VERSION_MATCH = re.match(
r'^([0-9]+\.[0-9]+)\..*$',
pkg_resources.get_distribution('pytest').version,
version('pytest'),
)
assert __PYTEST_MINOR_VERSION_MATCH is not None
__PYTEST_MINOR_VERSION = __PYTEST_MINOR_VERSION_MATCH.group(1)
Expand Down

0 comments on commit 214b920

Please sign in to comment.