Skip to content

Commit

Permalink
chore: bump minimal version to 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Jun 22, 2024
1 parent 47287d4 commit 4177406
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
python_version: ['3.12']
include:
- os: ubuntu-latest
python_version: '3.10'
python_version: '3.11'
timeout-minutes: 180
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ repos:
rev: v1.10.0
hooks:
- id: mypy
name: mypy 3.10 on cibuildwheel/
name: mypy 3.11 on cibuildwheel/
exclude: ^cibuildwheel/resources/.*py|bin/generate_schema.py$
args: ["--python-version=3.10"]
args: ["--python-version=3.11"]
additional_dependencies: &mypy-dependencies
- bracex
- nox
Expand Down
6 changes: 1 addition & 5 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@
import os
import subprocess
import sys
import tomllib
import urllib.parse
from pathlib import Path

import click
from packaging.version import InvalidVersion, Version

if sys.version_info < (3, 11):
import tomli as tomllib
else:
import tomllib

config = [
# file path, version find/replace format
("pyproject.toml", 'version = "{}"'),
Expand Down
3 changes: 1 addition & 2 deletions bin/update_nodejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import difflib
import logging
import tomllib
from dataclasses import dataclass
from pathlib import Path
from typing import Final
Expand All @@ -16,8 +17,6 @@
from rich.logging import RichHandler
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib

log = logging.getLogger("cibw")

# Looking up the dir instead of using utils.resources_dir
Expand Down
2 changes: 1 addition & 1 deletion bin/update_pythons.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import copy
import difflib
import logging
import tomllib
from collections.abc import Mapping, MutableMapping
from pathlib import Path
from typing import Any, Final, Literal, TypedDict
Expand All @@ -17,7 +18,6 @@
from rich.logging import RichHandler
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib
from cibuildwheel.extra import dump_python_configurations

log = logging.getLogger("cibw")
Expand Down
3 changes: 1 addition & 2 deletions bin/update_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import difflib
import logging
import subprocess
import tomllib
from dataclasses import dataclass
from pathlib import Path
from typing import Final
Expand All @@ -15,8 +16,6 @@
from rich.logging import RichHandler
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib

log = logging.getLogger("cibw")

# Looking up the dir instead of using utils.resources_dir
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from collections.abc import Iterable, Sequence, Set
from pathlib import Path
from tempfile import mkdtemp
from typing import Protocol
from typing import Protocol, assert_never

import cibuildwheel
import cibuildwheel.linux
Expand All @@ -21,7 +21,6 @@
import cibuildwheel.util
import cibuildwheel.windows
from cibuildwheel import errors
from cibuildwheel._compat.typing import assert_never
from cibuildwheel.architecture import Architecture, allowed_architectures_check
from cibuildwheel.logger import log
from cibuildwheel.options import CommandLineArguments, Options, compute_options
Expand Down
1 change: 0 additions & 1 deletion cibuildwheel/_compat/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions cibuildwheel/_compat/tomllib.py

This file was deleted.

14 changes: 0 additions & 14 deletions cibuildwheel/_compat/typing.py

This file was deleted.

3 changes: 1 addition & 2 deletions cibuildwheel/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import sys
from collections.abc import Set
from enum import Enum
from typing import Final, Literal
from typing import Final, Literal, assert_never

from ._compat.typing import assert_never
from .typing import PlatformName

PRETTY_NAMES: Final[dict[PlatformName, str]] = {
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from collections.abc import Iterable, Iterator, Sequence, Set
from dataclasses import dataclass
from pathlib import Path, PurePath, PurePosixPath
from typing import assert_never

from packaging.version import Version

from . import errors
from ._compat.typing import assert_never
from .architecture import Architecture
from .logger import log
from .oci_container import OCIContainer, OCIContainerEngineConfig
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
from collections.abc import Sequence, Set
from dataclasses import dataclass
from pathlib import Path
from typing import Literal
from typing import Literal, assert_never

from filelock import FileLock
from packaging.version import Version

from . import errors
from ._compat.typing import assert_never
from .architecture import Architecture
from .environment import ParsedEnvironment
from .logger import log
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/oci_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
from dataclasses import dataclass, field
from pathlib import Path, PurePath, PurePosixPath
from types import TracebackType
from typing import IO, Literal
from typing import IO, Literal, Self

from ._compat.typing import Self
from .typing import PathOrStr, PopenBytes
from .util import (
CIProvider,
Expand Down
5 changes: 2 additions & 3 deletions cibuildwheel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import functools
import shlex
import textwrap
import tomllib
from collections.abc import (
Callable,
Generator,
Expand All @@ -19,13 +20,11 @@
Set,
)
from pathlib import Path
from typing import Any, Literal, TypedDict
from typing import Any, Literal, NotRequired, TypedDict, assert_never

from packaging.specifiers import SpecifierSet

from . import errors
from ._compat import tomllib
from ._compat.typing import NotRequired, assert_never
from .architecture import Architecture
from .environment import EnvironmentParseError, ParsedEnvironment, parse_environment
from .logger import log
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/projectfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import ast
import configparser
import contextlib
import tomllib
from pathlib import Path

from ._compat import tomllib


def get_parent(node: ast.AST | None, depth: int = 1) -> ast.AST | None:
for _ in range(depth):
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import tarfile
import textwrap
import time
import tomllib
import typing
import urllib.request
from collections import defaultdict
Expand All @@ -35,7 +36,6 @@
from packaging.version import Version
from platformdirs import user_cache_path

from ._compat import tomllib
from .architecture import Architecture
from .typing import PathOrStr, PlatformName

Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
from dataclasses import dataclass
from functools import cache
from pathlib import Path
from typing import assert_never

from filelock import FileLock
from packaging.version import Version

from . import errors
from ._compat.typing import assert_never
from .architecture import Architecture
from .environment import ParsedEnvironment
from .logger import log
Expand Down
19 changes: 5 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "2.19.1"
description = "Build Python wheels on CI with minimal configuration."
readme = "README.md"
license = "BSD-2-Clause"
requires-python = ">=3.10"
requires-python = ">=3.11"
authors = [
{ name = "Joe Rickerby", email = "joerick@mac.com" },
]
Expand All @@ -30,7 +30,6 @@ classifiers = [
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
Expand All @@ -42,9 +41,7 @@ dependencies = [
"certifi",
"filelock",
"packaging>=20.9",
"platformdirs",
"tomli;python_version < '3.11'",
"typing-extensions>=4.1.0;python_version < '3.11'",
"platformdirs"
]

[project.optional-dependencies]
Expand Down Expand Up @@ -104,7 +101,7 @@ log_cli_level = "info"


[tool.mypy]
python_version = "3.10"
python_version = "3.11"
files = [
"cibuildwheel/*.py",
"test/**/*.py",
Expand Down Expand Up @@ -147,7 +144,7 @@ ignore_missing_imports = true


[tool.pylint]
py-version = "3.10"
py-version = "3.11"
jobs = "0"
fail-on = ["E", "F"]
fail-under = "9.8"
Expand Down Expand Up @@ -184,7 +181,7 @@ messages_control.disable = [
]

[tool.ruff]
target-version = "py310"
target-version = "py311"
line-length = 100


Expand Down Expand Up @@ -220,7 +217,6 @@ ignore = [
"PYI025", # Set as AbstractSet
"ISC001", # Conflicts with formatter
]
typing-modules = ["cibuildwheel._compat.typing"]
flake8-unused-arguments.ignore-variadic-names = true

[tool.ruff.lint.flake8-tidy-imports.banned-api]
Expand All @@ -229,14 +225,9 @@ flake8-unused-arguments.ignore-variadic-names = true
"typing.Iterator".msg = "Use collections.abc.Iterator instead."
"typing.Sequence".msg = "Use collections.abc.Sequence instead."
"typing.Set".msg = "Use collections.abc.Set instead."
"typing.NotRequired".msg = "Use cibuildwheel._compat.typing.NotRequired instead."
"typing.assert_never".msg = "Use cibuildwheel._compat.typing.assert_never instead."
"tomllib".msg = "Use cibuildwheel._compat.tomllib instead."
"tomli".msg = "Use cibuildwheel._compat.tomllib instead."

[tool.ruff.lint.per-file-ignores]
"unit_test/*" = ["PLC1901"]
"cibuildwheel/_compat/**.py" = ["TID251"]
"bin/*" = ["TID251"]

[tool.repo-review]
Expand Down
3 changes: 2 additions & 1 deletion unit_test/build_ids_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import tomllib

from packaging.version import Version

from cibuildwheel._compat import tomllib
from cibuildwheel.extra import Printable, dump_python_configurations
from cibuildwheel.util import resources_dir

Expand Down
2 changes: 1 addition & 1 deletion unit_test/main_tests/main_options_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import annotations

import sys
import tomllib
from fnmatch import fnmatch
from pathlib import Path

import pytest

from cibuildwheel.__main__ import main
from cibuildwheel._compat import tomllib
from cibuildwheel.environment import ParsedEnvironment
from cibuildwheel.options import BuildOptions, _get_pinned_container_images
from cibuildwheel.util import BuildSelector, resources_dir, split_config_settings
Expand Down
3 changes: 1 addition & 2 deletions unit_test/validate_schema_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from __future__ import annotations

import re
import tomllib
from pathlib import Path

import pytest
import validate_pyproject.api

from cibuildwheel._compat import tomllib

DIR = Path(__file__).parent.resolve()


Expand Down

0 comments on commit 4177406

Please sign in to comment.