Skip to content

Commit

Permalink
Add support for Python 3.13 and drop EOL 3.7 (#783)
Browse files Browse the repository at this point in the history
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
  • Loading branch information
hugovk and pradyunsg committed Mar 10, 2024
1 parent cb8fd38 commit 5cbe1e4
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
docs:
name: nox -s docs
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Expand Up @@ -16,6 +16,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
lint:
name: nox -s lint
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -14,6 +14,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
test:
name: ${{ matrix.os }} / ${{ matrix.python_version }}
Expand All @@ -23,7 +26,7 @@ jobs:
matrix:
os: [Ubuntu, Windows, macOS]
python_version:
["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10"]
["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
Expand Down
8 changes: 6 additions & 2 deletions docs/development/getting-started.rst
Expand Up @@ -30,11 +30,15 @@ each supported Python version and run the tests. For example:
$ nox -s tests
...
nox > Ran multiple sessions:
nox > * tests-3.7: success
nox > * tests-3.8: success
nox > * tests-3.9: success
nox > * tests-3.10: success
nox > * tests-pypy3: skipped
nox > * tests-3.11: success
nox > * tests-3.12: success
nox > * tests-3.13: success
nox > * tests-pypy3.8: skipped
nox > * tests-pypy3.9: skipped
nox > * tests-pypy3.10: skipped
You may not have all the required Python versions installed, in which case you
will see one or more ``InterpreterNotFound`` errors.
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Expand Up @@ -23,12 +23,12 @@

@nox.session(
python=[
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"pypy3.8",
"pypy3.9",
"pypy3.10",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -8,7 +8,7 @@ name = "packaging"
description = "Core utilities for Python packages"
dynamic = ["version"]
readme = "README.rst"
requires-python = ">=3.7"
requires-python = ">=3.8"
authors = [{name = "Donald Stufft", email = "donald@stufft.io"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -18,12 +18,12 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"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.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Typing :: Typed",
Expand Down
2 changes: 1 addition & 1 deletion src/packaging/_manylinux.py
Expand Up @@ -167,7 +167,7 @@ def _parse_glibc_version(version_str: str) -> Tuple[int, int]:
return int(m.group("major")), int(m.group("minor"))


@functools.lru_cache()
@functools.lru_cache
def _get_glibc_version() -> Tuple[int, int]:
version_str = _glibc_version_string()
if version_str is None:
Expand Down
2 changes: 1 addition & 1 deletion src/packaging/_musllinux.py
Expand Up @@ -28,7 +28,7 @@ def _parse_musl_version(output: str) -> Optional[_MuslVersion]:
return _MuslVersion(major=int(m.group(1)), minor=int(m.group(2)))


@functools.lru_cache()
@functools.lru_cache
def _get_musl_version(executable: str) -> Optional[_MuslVersion]:
"""Detect currently-running musl runtime version.
Expand Down
20 changes: 2 additions & 18 deletions src/packaging/metadata.py
Expand Up @@ -3,17 +3,18 @@
import email.message
import email.parser
import email.policy
import sys
import typing
from typing import (
Any,
Callable,
Dict,
Generic,
List,
Literal,
Optional,
Tuple,
Type,
TypedDict,
Union,
cast,
)
Expand All @@ -22,23 +23,6 @@
from . import version as version_module

T = typing.TypeVar("T")
if sys.version_info[:2] >= (3, 8): # pragma: no cover
from typing import Literal, TypedDict
else: # pragma: no cover
if typing.TYPE_CHECKING:
from typing_extensions import Literal, TypedDict
else:
try:
from typing_extensions import Literal, TypedDict
except ImportError:

class Literal:
def __init_subclass__(*_args, **_kwargs):
pass

class TypedDict:
def __init_subclass__(*_args, **_kwargs):
pass


try:
Expand Down

0 comments on commit 5cbe1e4

Please sign in to comment.