Skip to content

Commit

Permalink
Merge pull request #1526 from mayeut/drop-python-3.7
Browse files Browse the repository at this point in the history
chore: drop python 3.7 for cibuildwheel driver
joerick authored Jul 9, 2023
2 parents 8c6ff25 + 6415878 commit 740f081
Showing 24 changed files with 47 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ jobs:
python_version: ['3.11']
include:
- os: ubuntu-22.04
python_version: '3.7'
python_version: '3.8'
timeout-minutes: 180
steps:
- uses: actions/checkout@v3
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -34,9 +34,9 @@ repos:
rev: v1.4.1
hooks:
- id: mypy
name: mypy 3.7 on cibuildwheel/
name: mypy 3.8 on cibuildwheel/
exclude: ^cibuildwheel/resources/.*py$
args: ["--python-version=3.7"]
args: ["--python-version=3.8"]
additional_dependencies: &mypy-dependencies
- nox
- packaging
@@ -50,7 +50,6 @@ repos:
- types-pyyaml
- types-requests
- bracex
- markdown-it-py<3
- id: mypy
name: mypy 3.11
exclude: ^cibuildwheel/resources/.*py$
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -8,21 +8,21 @@ branches:

jobs:
include:
- name: Linux | x86_64 + i686 | Python 3.7
python: 3.7
- name: Linux | x86_64 + i686 | Python 3.9
python: 3.9
services: docker
env: PYTHON=python

- name: Linux | arm64 | Python 3.7
python: 3.7
- name: Linux | arm64 | Python 3.9
python: 3.9
services: docker
arch: arm64-graviton2
group: edge
virt: vm
env: PYTHON=python

- name: Linux | ppc64le | Python 3.7
python: 3.7
- name: Linux | ppc64le | Python 3.9
python: 3.9
services: docker
arch: ppc64le
allow_failure: True
@@ -32,16 +32,16 @@ jobs:
# c.f. https://travis-ci.community/t/running-out-of-disk-space-quota-when-using-docker-on-ppc64le/11634
- PYTEST_ADDOPTS='-k "not test_manylinuxXXXX_only"'

- name: Windows | x86_64 | Python 3.7
- name: Windows | x86_64 | Python 3.9
os: windows
language: shell
before_install:
- choco upgrade python3 -y --version 3.7.9 --limit-output
- choco upgrade python3 -y --version 3.9.13 --limit-output --params "/InstallDir:C:\\Python39"
env:
- PYTHON=C:\\Python37\\python
- PYTHON=C:\\Python39\\python

- name: Linux | s390x | Python 3.7
python: 3.7
- name: Linux | s390x | Python 3.9
python: 3.9
services: docker
arch: s390x
env: PYTHON=python
12 changes: 6 additions & 6 deletions CI.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
This is a summary of the Python versions and platforms covered by the different CI platforms:

| | 3.7 | 3.8 | 3.9 | 3.10 | 3.11 |
|---------|-----------|---------------------------------------|-----------|-----------|----------------|
| Linux | Travis CI | AppVeyor¹ / Azure Pipelines / GitLab¹ | CircleCI¹ | Cirrus CI | GitHub Actions |
| macOS | Travis CI | AppVeyor¹ / Azure Pipelines | CircleCI¹ | Cirrus CI | GitHub Actions |
| Windows | Travis CI | AppVeyor¹ / Azure Pipelines / GitLab¹ | | Cirrus CI | GitHub Actions |
| | 3.8 | 3.9 | 3.10 | 3.11 |
|---------|--------------------------------------------------------|-----------------------|-----------|----------------|
| Linux | AppVeyor¹ / Azure Pipelines / GitLab¹ / GitHub Actions | CircleCI¹ / Travis CI | Cirrus CI | GitHub Actions |
| macOS | AppVeyor¹ / Azure Pipelines | CircleCI¹ / Travis CI | Cirrus CI | GitHub Actions |
| Windows | AppVeyor¹ / Azure Pipelines / GitLab¹ | Travis CI | Cirrus CI | GitHub Actions |

> ¹ Runs a reduced set of tests to reduce CI load
Non-x86 architectures are covered on Travis CI using Python 3.7.
Non-x86 architectures are covered on Travis CI using Python 3.9.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ runs:
- uses: actions/setup-python@v4
id: python
with:
python-version: "3.7 - 3.11"
python-version: "3.8 - 3.11"
update-environment: false

# Redirecting stderr to stdout to fix interleaving issue in Actions.
3 changes: 1 addition & 2 deletions bin/update_pythons.py
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
import logging
from collections.abc import Mapping, MutableMapping
from pathlib import Path
from typing import Any, Union
from typing import Any, Final, Literal, TypedDict, Union

import click
import requests
@@ -18,7 +18,6 @@
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib
from cibuildwheel._compat.typing import Final, Literal, TypedDict
from cibuildwheel.extra import dump_python_configurations

log = logging.getLogger("cibw")
2 changes: 1 addition & 1 deletion bin/update_virtualenv.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import subprocess
from dataclasses import dataclass
from pathlib import Path
from typing import Final

import click
import rich
@@ -15,7 +16,6 @@
from rich.syntax import Syntax

from cibuildwheel._compat import tomllib
from cibuildwheel._compat.typing import Final

log = logging.getLogger("cibw")

3 changes: 2 additions & 1 deletion cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
@@ -10,13 +10,14 @@
from collections.abc import Iterable, Sequence, Set
from pathlib import Path
from tempfile import mkdtemp
from typing import Protocol

import cibuildwheel
import cibuildwheel.linux
import cibuildwheel.macos
import cibuildwheel.util
import cibuildwheel.windows
from cibuildwheel._compat.typing import Protocol, assert_never
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
66 changes: 0 additions & 66 deletions cibuildwheel/_compat/_functools_cached_property_38.py

This file was deleted.

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

This file was deleted.

11 changes: 0 additions & 11 deletions cibuildwheel/_compat/typing.py
Original file line number Diff line number Diff line change
@@ -2,23 +2,12 @@

import sys

if sys.version_info < (3, 8):
from typing_extensions import Final, Literal, OrderedDict, Protocol, TypedDict
else:
from typing import Final, Literal, OrderedDict, Protocol, TypedDict # noqa: TID251

if sys.version_info < (3, 11):
from typing_extensions import NotRequired, assert_never
else:
from typing import NotRequired, assert_never # noqa: TID251

__all__ = (
"Final",
"Literal",
"Protocol",
"Protocol",
"TypedDict",
"OrderedDict",
"assert_never",
"NotRequired",
)
3 changes: 2 additions & 1 deletion cibuildwheel/architecture.py
Original file line number Diff line number Diff line change
@@ -6,8 +6,9 @@
import sys
from collections.abc import Set
from enum import Enum
from typing import Final, Literal

from ._compat.typing import Final, Literal, assert_never
from ._compat.typing import assert_never
from .typing import PlatformName

PRETTY_NAMES: Final[dict[PlatformName, str]] = {
3 changes: 1 addition & 2 deletions cibuildwheel/environment.py
Original file line number Diff line number Diff line change
@@ -2,13 +2,12 @@

import dataclasses
from collections.abc import Mapping, Sequence
from typing import Any
from typing import Any, Protocol

import bashlex
import bashlex.errors

from . import bashlex_eval
from ._compat.typing import Protocol


class EnvironmentParseError(Exception):
3 changes: 1 addition & 2 deletions cibuildwheel/extra.py
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@

from collections.abc import Mapping, Sequence
from io import StringIO

from ._compat.typing import Protocol
from typing import Protocol

__all__ = ("Printable", "dump_python_configurations")

4 changes: 2 additions & 2 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
from collections.abc import Iterable, Iterator, Sequence, Set
from dataclasses import dataclass
from pathlib import Path, PurePath, PurePosixPath
from typing import Tuple
from typing import OrderedDict, Tuple

from ._compat.typing import OrderedDict, assert_never
from ._compat.typing import assert_never
from .architecture import Architecture
from .logger import log
from .oci_container import OCIContainer
3 changes: 1 addition & 2 deletions cibuildwheel/logger.py
Original file line number Diff line number Diff line change
@@ -5,9 +5,8 @@
import re
import sys
import time
from typing import IO, AnyStr, Tuple
from typing import IO, AnyStr, Final, Tuple

from ._compat.typing import Final
from .util import CIProvider, detect_ci_provider

FoldPattern = Tuple[str, str]
4 changes: 2 additions & 2 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@
from collections.abc import Sequence, Set
from dataclasses import dataclass
from pathlib import Path
from typing import Tuple
from typing import Literal, Tuple

from filelock import FileLock

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

from ._compat.typing import Literal
from .typing import PathOrStr, PopenBytes
from .util import CIProvider, detect_ci_provider, parse_key_value_string

4 changes: 2 additions & 2 deletions cibuildwheel/options.py
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@
import traceback
from collections.abc import Callable, Generator, Iterable, Iterator, Mapping, Set
from pathlib import Path
from typing import Any, Dict, List, Union
from typing import Any, Dict, List, Literal, TypedDict, Union

from packaging.specifiers import SpecifierSet

from ._compat import tomllib
from ._compat.typing import Literal, NotRequired, TypedDict
from ._compat.typing import NotRequired
from .architecture import Architecture
from .environment import EnvironmentParseError, ParsedEnvironment, parse_environment
from .logger import log
18 changes: 2 additions & 16 deletions cibuildwheel/projectfiles.py
Original file line number Diff line number Diff line change
@@ -3,24 +3,10 @@
import ast
import configparser
import contextlib
import sys
from pathlib import Path
from typing import Any

from ._compat import tomllib

if sys.version_info < (3, 8):
Constant = ast.Str

def get_constant(x: ast.Str) -> str:
return x.s

else:
Constant = ast.Constant

def get_constant(x: ast.Constant) -> Any:
return x.value


class Analyzer(ast.NodeVisitor):
def __init__(self) -> None:
@@ -39,9 +25,9 @@ def visit_keyword(self, node: ast.keyword) -> None:
if (
node.arg == "python_requires"
and not hasattr(node.parent.parent.parent, "parent") # type: ignore[attr-defined]
and isinstance(node.value, Constant)
and isinstance(node.value, ast.Constant)
):
self.requires_python = get_constant(node.value)
self.requires_python = node.value.value


def setup_py_python_requires(content: str) -> str | None:
4 changes: 1 addition & 3 deletions cibuildwheel/typing.py
Original file line number Diff line number Diff line change
@@ -3,9 +3,7 @@
import os
import subprocess
import typing
from typing import Union

from ._compat.typing import Final, Literal, Protocol
from typing import Final, Literal, Protocol, Union

__all__ = (
"PLATFORMS",
6 changes: 2 additions & 4 deletions cibuildwheel/util.py
Original file line number Diff line number Diff line change
@@ -17,10 +17,10 @@
from collections.abc import Generator, Iterable, Mapping, Sequence
from dataclasses import dataclass
from enum import Enum
from functools import lru_cache
from functools import cached_property, lru_cache
from pathlib import Path, PurePath
from time import sleep
from typing import Any, ClassVar, TextIO, TypeVar
from typing import Any, ClassVar, Final, Literal, TextIO, TypeVar

import bracex
import certifi
@@ -32,8 +32,6 @@
from platformdirs import user_cache_path

from ._compat import tomllib
from ._compat.functools import cached_property
from ._compat.typing import Final, Literal
from .typing import PathOrStr, PlatformName

__all__ = [
13 changes: 4 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[tool.black]
line-length = 100
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
target-version = ['py38', 'py39', 'py310', 'py311']


[tool.pytest.ini_options]
@@ -20,7 +20,7 @@ log_cli_level = "info"


[tool.mypy]
python_version = 3.7
python_version = 3.8
files = [
"cibuildwheel/*.py",
"test/**/*.py",
@@ -79,7 +79,7 @@ ignore = [
]

[tool.pylint]
py-version = "3.7"
py-version = "3.8"
jobs = "0"
fail-on = ["E", "F"]
fail-under = "9.8"
@@ -144,7 +144,7 @@ extend-ignore = [
"PT004", # Rename suggested for returnless fixtures
"PT007", # False positive (fixed upstream)
]
target-version = "py37"
target-version = "py38"
typing-modules = ["cibuildwheel._compat.typing"]
flake8-unused-arguments.ignore-variadic-names = true

@@ -154,11 +154,6 @@ 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.Protocol".msg = "Use cibuildwheel._compat.typing.Protocol instead."
"typing.Final".msg = "Use cibuildwheel._compat.typing.Final instead."
"typing.Literal".msg = "Use cibuildwheel._compat.typing.Literal instead."
"typing.OrderedDict".msg = "Use cibuildwheel._compat.typing.OrderedDict instead."
"typing.TypedDict".msg = "Use cibuildwheel._compat.typing.TypedDict 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."
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ classifiers =
Natural Language :: English
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
@@ -39,7 +38,7 @@ install_requires =
platformdirs
tomli;python_version < '3.11'
typing-extensions>=4.1.0;python_version < '3.11'
python_requires = >=3.7
python_requires = >=3.8
include_package_data = True
zip_safe = False

0 comments on commit 740f081

Please sign in to comment.