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
  • Loading branch information
joerick authored Jul 9, 2023
2 parents 8c6ff25 + 6415878 commit 740f081
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -50,7 +50,6 @@ repos:
- types-pyyaml
- types-requests
- bracex
- markdown-it-py<3
- id: mypy
name: mypy 3.11
exclude: ^cibuildwheel/resources/.*py$
Expand Down
22 changes: 11 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
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
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions bin/update_pythons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion bin/update_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import subprocess
from dataclasses import dataclass
from pathlib import Path
from typing import Final

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

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

log = logging.getLogger("cibw")

Expand Down
3 changes: 2 additions & 1 deletion cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
Expand Up @@ -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
Expand Up @@ -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]] = {
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 2 additions & 2 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions cibuildwheel/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
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

Expand Down
4 changes: 2 additions & 2 deletions cibuildwheel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 2 additions & 16 deletions cibuildwheel/projectfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
Loading

0 comments on commit 740f081

Please sign in to comment.