Skip to content

Commit

Permalink
Merge branch 'main' into document-default-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Mar 11, 2024
2 parents 89c0917 + 757f559 commit 15d5e8a
Show file tree
Hide file tree
Showing 20 changed files with 93 additions and 100 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1500a131381b66de0c52ac28abb13cd79f4b7ecc # v2.22.12
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -47,9 +47,9 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
- name: Autobuild
uses: github/codeql-action/autobuild@1500a131381b66de0c52ac28abb13cd79f4b7ecc # v2.22.12
uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1500a131381b66de0c52ac28abb13cd79f4b7ecc # v2.22.12
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
category: "/language:${{matrix.language}}"
7 changes: 5 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ 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
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
name: Install Python
with:
python-version: "3.9"
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ 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
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
name: Install Python
with:
python-version: "3.9"
Expand All @@ -43,13 +46,13 @@ jobs:
needs: lint

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Build
run: pipx run build

- name: Archive files
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: dist
path: dist
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
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,12 +26,12 @@ 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
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
name: Install Python ${{ matrix.python_version }}
with:
python-version: ${{ matrix.python_version }}
Expand Down
27 changes: 5 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,9 @@ repos:
args: []
additional_dependencies: [pyparsing, nox]

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: "6.0.0"
hooks:
- id: flake8
additional_dependencies: ["pep8-naming"]
# Ignore all format-related checks as Black takes care of those.
args: ["--ignore", "E2,W5", "--select", "E,W,F,N"]
- id: ruff
args: [ --fix ]
- id: ruff-format
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"

formats: [pdf]
sphinx:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog
*unreleased*
~~~~~~~~~~~~

No unreleased changes.

24.0 - 2024-03-10
~~~~~~~~~~~~~~~~~

* Do specifier matching correctly when the specifier contains an epoch number
and has more components than the version (:issue:`683`)
* Support the experimental ``--disable-gil`` builds in packaging.tags
Expand Down
8 changes: 6 additions & 2 deletions docs/development/getting-started.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
46 changes: 41 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
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 Expand Up @@ -58,6 +58,42 @@ module = ["_manylinux"]
ignore_missing_imports = true


[tool.isort]
profile = "black"
combine_as_imports = true
[tool.ruff]
src = ["src"]

[tool.ruff.lint]
extend-select = [
"B",
"E",
"F",
"I",
"N",
"UP",
"W"
]
ignore = [
"B009",
"B015",
"B018",
"B027",
"B028",
"B904",
"N818",
"UP032",
"UP030",
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
"E111",
"E114",
"E117",
"D206",
"D300",
"Q000",
"Q001",
"Q002",
"Q003",
"COM812",
"COM819",
"ISC001",
"ISC002",
]
2 changes: 1 addition & 1 deletion src/packaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"

__version__ = "23.3.dev0"
__version__ = "24.1.dev0"

__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"
Expand Down
2 changes: 1 addition & 1 deletion src/packaging/_manylinux.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion src/packaging/_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Handwritten parser of dependency specifiers.
The docstring for each __parse_* function contains ENBF-inspired grammar representing
The docstring for each __parse_* function contains EBNF-inspired grammar representing
the implementation.
"""

Expand Down
35 changes: 0 additions & 35 deletions src/packaging/_typing.py

This file was deleted.

6 changes: 3 additions & 3 deletions src/packaging/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@
import os
import platform
import sys
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
from typing import Any, Callable, Dict, List, Optional, Tuple, TypedDict, Union, cast

from ._parser import (
MarkerAtom,
MarkerList,
Op,
Value,
Variable,
)
from ._parser import (
parse_marker as _parse_marker,
)
from ._tokenizer import ParserSyntaxError
from ._typing import TypedDict
from .specifiers import InvalidSpecifier, Specifier
from .utils import canonicalize_name

Expand Down Expand Up @@ -142,7 +143,6 @@ def _normalize_extra_values(results: Any) -> Any:
def _format_marker(
marker: Union[List[str], MarkerAtom, str], first: Optional[bool] = True
) -> str:

assert isinstance(marker, (list, tuple, str))

# Sometimes we have a structure like [[...]] which is a single item list
Expand Down
8 changes: 5 additions & 3 deletions src/packaging/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
Dict,
Generic,
List,
Literal,
Optional,
Tuple,
Type,
TypedDict,
Union,
cast,
)

from . import requirements, specifiers, utils, version as version_module
from ._typing import Literal, TypedDict
from . import requirements, specifiers, utils
from . import version as version_module

T = typing.TypeVar("T")

Expand All @@ -27,7 +29,7 @@
ExceptionGroup
except NameError: # pragma: no cover

class ExceptionGroup(Exception): # noqa: N818
class ExceptionGroup(Exception):
"""A minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11.
If :external:exc:`ExceptionGroup` is already defined by Python itself,
Expand Down
Loading

0 comments on commit 15d5e8a

Please sign in to comment.