Merge branch 'main' into already-built
This commit is contained in:
@@ -5,6 +5,3 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
ignore:
|
||||
- dependency-name: "actions/*"
|
||||
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
|
||||
|
||||
@@ -27,7 +27,7 @@ repos:
|
||||
|
||||
# Autoremoves unused imports
|
||||
- repo: https://github.com/hadialqattan/pycln
|
||||
rev: v1.3.3
|
||||
rev: v1.3.5
|
||||
hooks:
|
||||
- id: pycln
|
||||
args: [--all]
|
||||
|
||||
+1
-1
@@ -184,7 +184,7 @@ def bump_version() -> None:
|
||||
print()
|
||||
|
||||
release_url = "https://github.com/pypa/cibuildwheel/releases/new?" + urllib.parse.urlencode(
|
||||
{"tag": new_version}
|
||||
{"tag": f"v{new_version}"}
|
||||
)
|
||||
print("Then create a release at the URL:")
|
||||
print(f" {release_url}")
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import configparser
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
|
||||
import requests
|
||||
|
||||
@@ -11,7 +11,8 @@ DIR = Path(__file__).parent.resolve()
|
||||
RESOURCES = DIR.parent / "cibuildwheel/resources"
|
||||
|
||||
|
||||
class Image(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class Image:
|
||||
manylinux_version: str
|
||||
platform: str
|
||||
image_name: str
|
||||
|
||||
@@ -6,8 +6,8 @@ import difflib
|
||||
import logging
|
||||
import subprocess
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
|
||||
import click
|
||||
import rich
|
||||
@@ -36,7 +36,8 @@ GET_VIRTUALENV_URL_TEMPLATE: Final[
|
||||
] = f"{GET_VIRTUALENV_GITHUB}/blob/{{version}}/public/virtualenv.pyz?raw=true"
|
||||
|
||||
|
||||
class VersionTuple(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class VersionTuple:
|
||||
version: Version
|
||||
version_string: str
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ def main() -> None:
|
||||
help="Enable pre-release Python versions if available.",
|
||||
)
|
||||
|
||||
args = parser.parse_args(namespace=CommandLineArguments())
|
||||
args = CommandLineArguments(**vars(parser.parse_args()))
|
||||
|
||||
args.package_dir = args.package_dir.resolve()
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import subprocess
|
||||
from typing import Callable, Dict, List, NamedTuple, Optional, Sequence
|
||||
from dataclasses import dataclass
|
||||
from typing import Callable, Dict, List, Optional, Sequence
|
||||
|
||||
import bashlex
|
||||
|
||||
@@ -13,7 +14,8 @@ def local_environment_executor(command: List[str], env: Dict[str, str]) -> str:
|
||||
).stdout
|
||||
|
||||
|
||||
class NodeExecutionContext(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class NodeExecutionContext:
|
||||
environment: Dict[str, str]
|
||||
input: str
|
||||
executor: EnvironmentExecutor
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path, PurePath, PurePosixPath
|
||||
from typing import Iterator, List, NamedTuple, Set, Tuple
|
||||
from typing import Iterator, List, Set, Tuple
|
||||
|
||||
from .architecture import Architecture
|
||||
from .docker_container import DockerContainer
|
||||
@@ -20,7 +21,8 @@ from .util import (
|
||||
)
|
||||
|
||||
|
||||
class PythonConfiguration(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
identifier: str
|
||||
path_str: str
|
||||
@@ -30,7 +32,8 @@ class PythonConfiguration(NamedTuple):
|
||||
return PurePosixPath(self.path_str)
|
||||
|
||||
|
||||
class BuildStep(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class BuildStep:
|
||||
platform_configs: List[PythonConfiguration]
|
||||
platform_tag: str
|
||||
docker_image: str
|
||||
|
||||
@@ -5,8 +5,9 @@ import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, NamedTuple, Sequence, Set, Tuple, cast
|
||||
from typing import Dict, List, Sequence, Set, Tuple, cast
|
||||
|
||||
from filelock import FileLock
|
||||
|
||||
@@ -55,7 +56,8 @@ def get_macos_sdks() -> List[str]:
|
||||
return [m.group(1) for m in re.finditer(r"-sdk (macosx\S+)", output)]
|
||||
|
||||
|
||||
class PythonConfiguration(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
identifier: str
|
||||
url: str
|
||||
|
||||
+12
-18
@@ -4,19 +4,9 @@ import sys
|
||||
import traceback
|
||||
from configparser import ConfigParser
|
||||
from contextlib import contextmanager
|
||||
from dataclasses import asdict, dataclass
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Generator,
|
||||
List,
|
||||
Mapping,
|
||||
NamedTuple,
|
||||
Optional,
|
||||
Set,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
from typing import Any, Dict, Generator, List, Mapping, Optional, Set, Tuple, Union
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
import tomllib
|
||||
@@ -45,6 +35,7 @@ from .util import (
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class CommandLineArguments:
|
||||
platform: Literal["auto", "linux", "macos", "windows"]
|
||||
archs: Optional[str]
|
||||
@@ -56,7 +47,8 @@ class CommandLineArguments:
|
||||
prerelease_pythons: bool
|
||||
|
||||
|
||||
class GlobalOptions(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class GlobalOptions:
|
||||
package_dir: Path
|
||||
output_dir: Path
|
||||
build_selector: BuildSelector
|
||||
@@ -64,7 +56,8 @@ class GlobalOptions(NamedTuple):
|
||||
architectures: Set[Architecture]
|
||||
|
||||
|
||||
class BuildOptions(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class BuildOptions:
|
||||
globals: GlobalOptions
|
||||
environment: ParsedEnvironment
|
||||
before_all: str
|
||||
@@ -104,7 +97,8 @@ class BuildOptions(NamedTuple):
|
||||
Setting = Union[Dict[str, str], List[str], str, int]
|
||||
|
||||
|
||||
class Override(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class Override:
|
||||
select_pattern: str
|
||||
options: Dict[str, Setting]
|
||||
|
||||
@@ -548,12 +542,12 @@ class Options:
|
||||
def summary(self, identifiers: List[str]) -> str:
|
||||
lines = [
|
||||
f"{option_name}: {option_value!r}"
|
||||
for option_name, option_value in sorted(self.globals._asdict().items())
|
||||
for option_name, option_value in sorted(asdict(self.globals).items())
|
||||
]
|
||||
|
||||
build_option_defaults = self.build_options(identifier=None)
|
||||
|
||||
for option_name, default_value in sorted(build_option_defaults._asdict().items()):
|
||||
for option_name, default_value in sorted(asdict(build_option_defaults).items()):
|
||||
if option_name == "globals":
|
||||
continue
|
||||
|
||||
@@ -561,7 +555,7 @@ class Options:
|
||||
|
||||
# if any identifiers have an overridden value, print that too
|
||||
for identifier in identifiers:
|
||||
option_value = self.build_options(identifier=identifier)._asdict()[option_name]
|
||||
option_value = getattr(self.build_options(identifier=identifier), option_name)
|
||||
if option_value != default_value:
|
||||
lines.append(f" {identifier}: {option_value!r}")
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ six==1.16.0
|
||||
# via virtualenv
|
||||
typing-extensions==4.2.0
|
||||
# via delocate
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
@@ -26,5 +26,5 @@ wheel==0.37.1
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
pip==22.1.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
setuptools==62.4.0
|
||||
setuptools==62.6.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
|
||||
@@ -16,7 +16,7 @@ six==1.16.0
|
||||
# via virtualenv
|
||||
typing-extensions==4.2.0
|
||||
# via delocate
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
@@ -26,5 +26,5 @@ wheel==0.37.1
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
pip==22.1.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
setuptools==62.4.0
|
||||
setuptools==62.6.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
|
||||
@@ -22,7 +22,7 @@ typing-extensions==4.1.1
|
||||
# via
|
||||
# delocate
|
||||
# importlib-metadata
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
|
||||
@@ -10,7 +10,7 @@ distlib==0.3.4
|
||||
# via virtualenv
|
||||
filelock==3.7.1
|
||||
# via virtualenv
|
||||
importlib-metadata==4.11.4
|
||||
importlib-metadata==4.12.0
|
||||
# via virtualenv
|
||||
platformdirs==2.5.2
|
||||
# via virtualenv
|
||||
@@ -20,7 +20,7 @@ typing-extensions==4.2.0
|
||||
# via
|
||||
# delocate
|
||||
# importlib-metadata
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
@@ -32,5 +32,5 @@ zipp==3.8.0
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
pip==22.1.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
setuptools==62.4.0
|
||||
setuptools==62.6.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
|
||||
@@ -16,7 +16,7 @@ six==1.16.0
|
||||
# via virtualenv
|
||||
typing-extensions==4.2.0
|
||||
# via delocate
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
@@ -26,5 +26,5 @@ wheel==0.37.1
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
pip==22.1.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
setuptools==62.4.0
|
||||
setuptools==62.6.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
|
||||
@@ -16,7 +16,7 @@ six==1.16.0
|
||||
# via virtualenv
|
||||
typing-extensions==4.2.0
|
||||
# via delocate
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
@@ -26,5 +26,5 @@ wheel==0.37.1
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
pip==22.1.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
setuptools==62.4.0
|
||||
setuptools==62.6.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
|
||||
@@ -16,7 +16,7 @@ six==1.16.0
|
||||
# via virtualenv
|
||||
typing-extensions==4.2.0
|
||||
# via delocate
|
||||
virtualenv==20.14.1
|
||||
virtualenv==20.15.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
wheel==0.37.1
|
||||
# via
|
||||
@@ -26,5 +26,5 @@ wheel==0.37.1
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
pip==22.1.2
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
setuptools==62.4.0
|
||||
setuptools==62.6.0
|
||||
# via -r cibuildwheel/resources/constraints.in
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
[x86_64]
|
||||
manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-06-12-a846b05
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-13-c365205
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-13-c365205
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-06-13-c365205
|
||||
manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-06-26-ddecca8
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-26-9a2ca4b
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-26-9a2ca4b
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-26-9a2ca4b
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-06-26-9a2ca4b
|
||||
|
||||
[i686]
|
||||
manylinux1 = quay.io/pypa/manylinux1_i686:2022-06-12-a846b05
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-13-c365205
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-06-13-c365205
|
||||
manylinux1 = quay.io/pypa/manylinux1_i686:2022-06-26-ddecca8
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-26-9a2ca4b
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-26-9a2ca4b
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-06-26-9a2ca4b
|
||||
|
||||
[pypy_x86_64]
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-13-c365205
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-13-c365205
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-26-9a2ca4b
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-26-9a2ca4b
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-26-9a2ca4b
|
||||
|
||||
[pypy_i686]
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-13-c365205
|
||||
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-26-9a2ca4b
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-26-9a2ca4b
|
||||
|
||||
[aarch64]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-13-c365205
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-13-c365205
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-26-9a2ca4b
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-26-9a2ca4b
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-06-26-9a2ca4b
|
||||
|
||||
[ppc64le]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-06-13-c365205
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2022-06-13-c365205
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-06-26-9a2ca4b
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2022-06-26-9a2ca4b
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-06-26-9a2ca4b
|
||||
|
||||
[s390x]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2022-06-13-c365205
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2022-06-26-9a2ca4b
|
||||
musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-06-26-9a2ca4b
|
||||
|
||||
[pypy_aarch64]
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-13-c365205
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-13-c365205
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-13-c365205
|
||||
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-26-9a2ca4b
|
||||
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-26-9a2ca4b
|
||||
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-26-9a2ca4b
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = "20.14.1"
|
||||
url = "https://github.com/pypa/get-virtualenv/blob/20.14.1/public/virtualenv.pyz?raw=true"
|
||||
version = "20.15.0"
|
||||
url = "https://github.com/pypa/get-virtualenv/blob/20.15.0/public/virtualenv.pyz?raw=true"
|
||||
|
||||
+22
-12
@@ -1,5 +1,4 @@
|
||||
import contextlib
|
||||
import dataclasses
|
||||
import fnmatch
|
||||
import itertools
|
||||
import os
|
||||
@@ -11,6 +10,7 @@ import sys
|
||||
import textwrap
|
||||
import time
|
||||
import urllib.request
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from functools import lru_cache
|
||||
from pathlib import Path, PurePath
|
||||
@@ -22,7 +22,6 @@ from typing import (
|
||||
Generator,
|
||||
Iterable,
|
||||
List,
|
||||
NamedTuple,
|
||||
Optional,
|
||||
Sequence,
|
||||
TextIO,
|
||||
@@ -233,7 +232,7 @@ def selector_matches(patterns: str, string: str) -> bool:
|
||||
|
||||
|
||||
# Once we require Python 3.10+, we can add kw_only=True
|
||||
@dataclasses.dataclass
|
||||
@dataclass(frozen=True)
|
||||
class BuildSelector:
|
||||
"""
|
||||
This class holds a set of build/skip patterns. You call an instance with a
|
||||
@@ -270,7 +269,7 @@ class BuildSelector:
|
||||
return should_build and not should_skip
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
@dataclass(frozen=True)
|
||||
class TestSelector:
|
||||
"""
|
||||
A build selector that can only skip tests according to a skip pattern.
|
||||
@@ -432,6 +431,12 @@ def unwrap(text: str) -> str:
|
||||
return re.sub(r"\s+", " ", text)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class FileReport:
|
||||
name: str
|
||||
size: str
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def print_new_wheels(msg: str, output_dir: Path) -> Generator[None, None, None]:
|
||||
"""
|
||||
@@ -446,10 +451,6 @@ def print_new_wheels(msg: str, output_dir: Path) -> Generator[None, None, None]:
|
||||
yield
|
||||
final_contents = set(output_dir.iterdir())
|
||||
|
||||
class FileReport(NamedTuple):
|
||||
name: str
|
||||
size: str
|
||||
|
||||
new_contents = [
|
||||
FileReport(wheel.name, f"{(wheel.stat().st_size + 1023) // 1024:,d}")
|
||||
for wheel in final_contents - existing_contents
|
||||
@@ -591,7 +592,7 @@ T = TypeVar("T", bound=PurePath)
|
||||
def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> Optional[T]:
|
||||
"""
|
||||
Finds a wheel with an abi3 or a none ABI tag in `wheels` compatible with the Python interpreter
|
||||
specified by `identifier`.
|
||||
specified by `identifier` that is previously built.
|
||||
"""
|
||||
|
||||
interpreter, platform = identifier.split("-")
|
||||
@@ -599,27 +600,36 @@ def find_compatible_wheel(wheels: Sequence[T], identifier: str) -> Optional[T]:
|
||||
_, _, _, tags = parse_wheel_filename(wheel.name)
|
||||
for tag in tags:
|
||||
if tag.abi == "abi3":
|
||||
# ABI3 wheels must start with cp3 for impl and tag
|
||||
if not (interpreter.startswith("cp3") and tag.interpreter.startswith("cp3")):
|
||||
continue
|
||||
elif tag.abi == "none":
|
||||
# CPythonless wheels must include py3 tag
|
||||
if tag.interpreter[:3] != "py3":
|
||||
continue
|
||||
else:
|
||||
# Other types of wheels are not detected, this is looking for previously built wheels.
|
||||
continue
|
||||
|
||||
if tag.interpreter != "py3" and int(tag.interpreter[3:]) > int(interpreter[3:]):
|
||||
# If a minor version number is given, it has to be lower than the current one.
|
||||
continue
|
||||
|
||||
if platform.startswith(("manylinux", "musllinux", "macosx")):
|
||||
# Linux, macOS
|
||||
# Linux, macOS require the beginning and ending match (macos/manylinux version doesn't need to)
|
||||
os_, arch = platform.split("_", 1)
|
||||
if not tag.platform.startswith(os_):
|
||||
continue
|
||||
if not tag.platform.endswith("_" + arch):
|
||||
if not tag.platform.endswith(f"_{arch}"):
|
||||
continue
|
||||
else:
|
||||
# Windows
|
||||
# Windows should exactly match
|
||||
if not tag.platform == platform:
|
||||
continue
|
||||
|
||||
# If all the filters above pass, then the wheel is a previously built compatible wheel.
|
||||
return wheel
|
||||
|
||||
return None
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@ import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, NamedTuple, Optional, Sequence, Set
|
||||
from typing import Dict, List, Optional, Sequence, Set
|
||||
from zipfile import ZipFile
|
||||
|
||||
from filelock import FileLock
|
||||
@@ -47,7 +48,8 @@ def get_nuget_args(version: str, arch: str, output_directory: Path) -> List[str]
|
||||
]
|
||||
|
||||
|
||||
class PythonConfiguration(NamedTuple):
|
||||
@dataclass(frozen=True)
|
||||
class PythonConfiguration:
|
||||
version: str
|
||||
arch: str
|
||||
identifier: str
|
||||
|
||||
@@ -147,10 +147,6 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
ignore:
|
||||
# Optional: Official actions have moving tags like v1;
|
||||
# if you use those, you don't need updates.
|
||||
- dependency-name: "actions/*"
|
||||
```
|
||||
|
||||
#### Option 2: Requirement files
|
||||
|
||||
@@ -553,6 +553,10 @@ Platform-specific environment variables are also available:<br/>
|
||||
# Supply options to `pip` to affect how it downloads dependencies
|
||||
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.myorg.com/simple
|
||||
|
||||
# Any pip command-line options can be set using the PIP_ prefix
|
||||
# https://pip.pypa.io/en/stable/topics/configuration/#environment-variables
|
||||
CIBW_ENVIRONMENT: PIP_GLOBAL_OPTION="build_ext -j4"
|
||||
|
||||
# Set two flags on linux only
|
||||
CIBW_ENVIRONMENT_LINUX: BUILD_TIME="$(date)" SAMPLE_TEXT="sample text"
|
||||
```
|
||||
@@ -582,6 +586,10 @@ Platform-specific environment variables are also available:<br/>
|
||||
# Supply options to `pip` to affect how it downloads dependencies
|
||||
environment = { PIP_EXTRA_INDEX_URL="https://pypi.myorg.com/simple" }
|
||||
|
||||
# Any pip command-line option can be set using the PIP_ prefix
|
||||
# https://pip.pypa.io/en/stable/topics/configuration/#environment-variables
|
||||
environment = { PIP_GLOBAL_OPTION="build_ext -j4" }
|
||||
|
||||
# Set two flags on linux only
|
||||
[tool.cibuildwheel.linux]
|
||||
environment = { BUILD_TIME="$(date)", SAMPLE_TEXT="sample text" }
|
||||
|
||||
+104
-104
@@ -18,8 +18,8 @@ title: Working examples
|
||||
| [Prophet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth. |
|
||||
| [MyPy][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | The compiled version of MyPy using MyPyC. |
|
||||
| [pydantic][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Data parsing and validation using Python type hints |
|
||||
| [uvloop][] | ![github icon][] | ![apple icon][] ![linux icon][] | Ultra fast asyncio event loop. |
|
||||
| [MemRay][] | ![github icon][] | ![linux icon][] | Memray is a memory profiler for Python |
|
||||
| [uvloop][] | ![github icon][] | ![apple icon][] ![linux icon][] | Ultra fast asyncio event loop. |
|
||||
| [psutil][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Cross-platform lib for process and system monitoring in Python |
|
||||
| [vaex][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Out-of-Core hybrid Apache Arrow/NumPy DataFrame for Python, ML, visualization and exploration of big tabular data at a billion rows per second 🚀 |
|
||||
| [Google Benchmark][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A microbenchmark support library |
|
||||
@@ -52,8 +52,8 @@ title: Working examples
|
||||
| [Wrapt][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python module for decorators, wrappers and monkey patching. |
|
||||
| [PyAV][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Pythonic bindings for FFmpeg's libraries. |
|
||||
| [SimpleJSON][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | simplejson is a simple, fast, extensible JSON encoder/decoder for Python |
|
||||
| [OpenColorIO][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A color management framework for visual effects and animation. |
|
||||
| [pikepdf][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python library for reading and writing PDF, powered by qpdf |
|
||||
| [OpenColorIO][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | A color management framework for visual effects and animation. |
|
||||
| [Line Profiler][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Line-by-line profiling for Python |
|
||||
| [PyTables][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python package to manage extremely large amounts of data |
|
||||
| [OpenTimelineIO][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Open Source API and interchange format for editorial timeline information. |
|
||||
@@ -75,8 +75,8 @@ title: Working examples
|
||||
| [pybind11 python_example][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Example pybind11 module built with a Python-based build system |
|
||||
| [dd-trace-py][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Uses custom alternate arch emulation on GitHub |
|
||||
| [sourmash][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Quickly search, compare, and analyze genomic and metagenomic data sets. |
|
||||
| [time-machine][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Time mocking library using only the CPython C API. |
|
||||
| [CTranslate2][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Includes libraries from the [Intel oneAPI toolkit](https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html) and CUDA kernels compiled for multiple GPU architectures. |
|
||||
| [time-machine][] | ![github icon][] | ![apple icon][] ![linux icon][] ![windows icon][] | Time mocking library using only the CPython C API. |
|
||||
| [cyvcf2][] | ![github icon][] | ![apple icon][] ![linux icon][] | cython + htslib == fast VCF and BCF processing |
|
||||
| [matrixprofile][] | ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone. |
|
||||
| [abess][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | A fast best-subset selection library. It uses cibuildwheel to build a large project with C++ extensions. |
|
||||
@@ -118,8 +118,8 @@ title: Working examples
|
||||
[Prophet]: https://github.com/facebook/prophet
|
||||
[MyPy]: https://github.com/mypyc/mypy_mypyc-wheels
|
||||
[pydantic]: https://github.com/samuelcolvin/pydantic
|
||||
[uvloop]: https://github.com/MagicStack/uvloop
|
||||
[MemRay]: https://github.com/bloomberg/memray
|
||||
[uvloop]: https://github.com/MagicStack/uvloop
|
||||
[psutil]: https://github.com/giampaolo/psutil
|
||||
[vaex]: https://github.com/vaexio/vaex
|
||||
[Google Benchmark]: https://github.com/google/benchmark
|
||||
@@ -152,8 +152,8 @@ title: Working examples
|
||||
[Wrapt]: https://github.com/GrahamDumpleton/wrapt
|
||||
[PyAV]: https://github.com/PyAV-Org/PyAV
|
||||
[SimpleJSON]: https://github.com/simplejson/simplejson
|
||||
[OpenColorIO]: https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
[pikepdf]: https://github.com/pikepdf/pikepdf
|
||||
[OpenColorIO]: https://github.com/AcademySoftwareFoundation/OpenColorIO
|
||||
[Line Profiler]: https://github.com/pyutils/line_profiler
|
||||
[PyTables]: https://github.com/PyTables/PyTables
|
||||
[OpenTimelineIO]: https://github.com/PixarAnimationStudios/OpenTimelineIO
|
||||
@@ -175,8 +175,8 @@ title: Working examples
|
||||
[pybind11 python_example]: https://github.com/pybind/python_example
|
||||
[dd-trace-py]: https://github.com/DataDog/dd-trace-py
|
||||
[sourmash]: https://github.com/dib-lab/sourmash
|
||||
[time-machine]: https://github.com/adamchainz/time-machine
|
||||
[CTranslate2]: https://github.com/OpenNMT/CTranslate2
|
||||
[time-machine]: https://github.com/adamchainz/time-machine
|
||||
[cyvcf2]: https://github.com/brentp/cyvcf2
|
||||
[matrixprofile]: https://github.com/matrix-profile-foundation/matrixprofile
|
||||
[abess]: https://github.com/abess-team/abess
|
||||
@@ -218,105 +218,105 @@ title: Working examples
|
||||
[apple icon]: data/readme_icons/apple.svg
|
||||
[linux icon]: data/readme_icons/linux.svg
|
||||
|
||||
<!-- scikit-learn: 50434, last pushed 0 days ago -->
|
||||
<!-- NumPy: 20694, last pushed 0 days ago -->
|
||||
<!-- Tornado: 20578, last pushed 0 days ago -->
|
||||
<!-- pytorch-fairseq: 17225, last pushed 0 days ago -->
|
||||
<!-- Matplotlib: 15650, last pushed 0 days ago -->
|
||||
<!-- NCNN: 14749, last pushed 0 days ago -->
|
||||
<!-- Kivy: 14695, last pushed 15 days ago -->
|
||||
<!-- Prophet: 14557, last pushed 10 days ago -->
|
||||
<!-- MyPy: 13244, last pushed 0 days ago -->
|
||||
<!-- pydantic: 10153, last pushed 0 days ago -->
|
||||
<!-- uvloop: 8665, last pushed 5 days ago -->
|
||||
<!-- MemRay: 8648, last pushed 0 days ago -->
|
||||
<!-- psutil: 8466, last pushed 10 days ago -->
|
||||
<!-- vaex: 7118, last pushed 1 days ago -->
|
||||
<!-- Google Benchmark: 6558, last pushed 0 days ago -->
|
||||
<!-- Apache Beam: 5592, last pushed 0 days ago -->
|
||||
<!-- asyncpg: 5511, last pushed 1 days ago -->
|
||||
<!-- duckdb: 5277, last pushed 0 days ago -->
|
||||
<!-- scikit-image: 4935, last pushed 0 days ago -->
|
||||
<!-- PyGame: 4875, last pushed 0 days ago -->
|
||||
<!-- cmake: 4832, last pushed 0 days ago -->
|
||||
<!-- twisted-iocpsupport: 4628, last pushed 0 days ago -->
|
||||
<!-- websockets: 3974, last pushed 31 days ago -->
|
||||
<!-- cvxpy: 3961, last pushed 1 days ago -->
|
||||
<!-- PyOxidizer: 3859, last pushed 1 days ago -->
|
||||
<!-- UltraJSON: 3730, last pushed 1 days ago -->
|
||||
<!-- Triton: 3657, last pushed 0 days ago -->
|
||||
<!-- River: 3439, last pushed 0 days ago -->
|
||||
<!-- OpenSpiel: 3214, last pushed 1 days ago -->
|
||||
<!-- pyzmq: 3099, last pushed 0 days ago -->
|
||||
<!-- aiortc: 2949, last pushed 8 days ago -->
|
||||
<!-- vispy: 2883, last pushed 2 days ago -->
|
||||
<!-- Implicit: 2808, last pushed 5 days ago -->
|
||||
<!-- Confluent client for Kafka: 2805, last pushed 0 days ago -->
|
||||
<!-- tinyobjloader: 2557, last pushed 170 days ago -->
|
||||
<!-- Dependency Injector: 2172, last pushed 59 days ago -->
|
||||
<!-- coverage.py: 2072, last pushed 0 days ago -->
|
||||
<!-- PyCryptodome: 2018, last pushed 7 days ago -->
|
||||
<!-- PyYAML: 1865, last pushed 5 days ago -->
|
||||
<!-- numexpr: 1758, last pushed 20 days ago -->
|
||||
<!-- scikit-learn: 50552, last pushed 0 days ago -->
|
||||
<!-- NumPy: 20789, last pushed 0 days ago -->
|
||||
<!-- Tornado: 20596, last pushed 4 days ago -->
|
||||
<!-- pytorch-fairseq: 17326, last pushed 2 days ago -->
|
||||
<!-- Matplotlib: 15701, last pushed 0 days ago -->
|
||||
<!-- NCNN: 14830, last pushed 0 days ago -->
|
||||
<!-- Kivy: 14729, last pushed 4 days ago -->
|
||||
<!-- Prophet: 14599, last pushed 1 days ago -->
|
||||
<!-- MyPy: 13302, last pushed 0 days ago -->
|
||||
<!-- pydantic: 10245, last pushed 4 days ago -->
|
||||
<!-- MemRay: 8722, last pushed 4 days ago -->
|
||||
<!-- uvloop: 8690, last pushed 5 days ago -->
|
||||
<!-- psutil: 8491, last pushed 1 days ago -->
|
||||
<!-- vaex: 7130, last pushed 0 days ago -->
|
||||
<!-- Google Benchmark: 6593, last pushed 5 days ago -->
|
||||
<!-- Apache Beam: 5624, last pushed 0 days ago -->
|
||||
<!-- asyncpg: 5532, last pushed 10 days ago -->
|
||||
<!-- duckdb: 5387, last pushed 0 days ago -->
|
||||
<!-- scikit-image: 4952, last pushed 3 days ago -->
|
||||
<!-- PyGame: 4921, last pushed 0 days ago -->
|
||||
<!-- cmake: 4852, last pushed 0 days ago -->
|
||||
<!-- twisted-iocpsupport: 4636, last pushed 1 days ago -->
|
||||
<!-- websockets: 3990, last pushed 0 days ago -->
|
||||
<!-- cvxpy: 3977, last pushed 0 days ago -->
|
||||
<!-- PyOxidizer: 3892, last pushed 9 days ago -->
|
||||
<!-- UltraJSON: 3735, last pushed 6 days ago -->
|
||||
<!-- Triton: 3683, last pushed 0 days ago -->
|
||||
<!-- River: 3458, last pushed 4 days ago -->
|
||||
<!-- OpenSpiel: 3226, last pushed 0 days ago -->
|
||||
<!-- pyzmq: 3111, last pushed 1 days ago -->
|
||||
<!-- aiortc: 2963, last pushed 1 days ago -->
|
||||
<!-- vispy: 2892, last pushed 1 days ago -->
|
||||
<!-- Implicit: 2821, last pushed 2 days ago -->
|
||||
<!-- Confluent client for Kafka: 2817, last pushed 2 days ago -->
|
||||
<!-- tinyobjloader: 2570, last pushed 7 days ago -->
|
||||
<!-- Dependency Injector: 2193, last pushed 70 days ago -->
|
||||
<!-- coverage.py: 2081, last pushed 6 days ago -->
|
||||
<!-- PyCryptodome: 2025, last pushed 1 days ago -->
|
||||
<!-- PyYAML: 1868, last pushed 17 days ago -->
|
||||
<!-- numexpr: 1765, last pushed 1 days ago -->
|
||||
<!-- h5py: 1747, last pushed 0 days ago -->
|
||||
<!-- Wrapt: 1686, last pushed 44 days ago -->
|
||||
<!-- PyAV: 1579, last pushed 27 days ago -->
|
||||
<!-- SimpleJSON: 1495, last pushed 54 days ago -->
|
||||
<!-- OpenColorIO: 1320, last pushed 4 days ago -->
|
||||
<!-- pikepdf: 1308, last pushed 5 days ago -->
|
||||
<!-- Line Profiler: 1244, last pushed 5 days ago -->
|
||||
<!-- PyTables: 1132, last pushed 57 days ago -->
|
||||
<!-- OpenTimelineIO: 1063, last pushed 6 days ago -->
|
||||
<!-- ruptures: 974, last pushed 29 days ago -->
|
||||
<!-- aioquic: 956, last pushed 0 days ago -->
|
||||
<!-- DeepForest: 763, last pushed 32 days ago -->
|
||||
<!-- google neuroglancer: 737, last pushed 0 days ago -->
|
||||
<!-- Psycopg 3: 696, last pushed 0 days ago -->
|
||||
<!-- Parselmouth: 662, last pushed 71 days ago -->
|
||||
<!-- AutoPy: 653, last pushed 172 days ago -->
|
||||
<!-- H3-py: 538, last pushed 6 days ago -->
|
||||
<!-- Rtree: 481, last pushed 57 days ago -->
|
||||
<!-- markupsafe: 472, last pushed 1 days ago -->
|
||||
<!-- python-rapidjson: 454, last pushed 20 days ago -->
|
||||
<!-- python-snappy: 438, last pushed 90 days ago -->
|
||||
<!-- pybind11 cmake_example: 411, last pushed 7 days ago -->
|
||||
<!-- KDEpy: 376, last pushed 125 days ago -->
|
||||
<!-- tgcalls: 364, last pushed 10 days ago -->
|
||||
<!-- pybind11 python_example: 331, last pushed 7 days ago -->
|
||||
<!-- dd-trace-py: 325, last pushed 0 days ago -->
|
||||
<!-- sourmash: 307, last pushed 0 days ago -->
|
||||
<!-- time-machine: 304, last pushed 1 days ago -->
|
||||
<!-- CTranslate2: 300, last pushed 1 days ago -->
|
||||
<!-- cyvcf2: 299, last pushed 25 days ago -->
|
||||
<!-- matrixprofile: 269, last pushed 1 days ago -->
|
||||
<!-- abess: 266, last pushed 0 days ago -->
|
||||
<!-- jq.py: 218, last pushed 129 days ago -->
|
||||
<!-- iminuit: 206, last pushed 2 days ago -->
|
||||
<!-- Tokenizer: 184, last pushed 100 days ago -->
|
||||
<!-- PyGLM: 142, last pushed 78 days ago -->
|
||||
<!-- boost-histogram: 114, last pushed 1 days ago -->
|
||||
<!-- bx-python: 113, last pushed 161 days ago -->
|
||||
<!-- iDynTree: 105, last pushed 4 days ago -->
|
||||
<!-- TgCrypto: 104, last pushed 103 days ago -->
|
||||
<!-- Python-WebRTC: 89, last pushed 96 days ago -->
|
||||
<!-- pybase64: 83, last pushed 1 days ago -->
|
||||
<!-- Arbor: 73, last pushed 0 days ago -->
|
||||
<!-- fathon: 61, last pushed 12 days ago -->
|
||||
<!-- etebase-py: 57, last pushed 0 days ago -->
|
||||
<!-- Imagecodecs (fork): 45, last pushed 0 days ago -->
|
||||
<!-- polaroid: 41, last pushed 34 days ago -->
|
||||
<!-- clang-format: 39, last pushed 2 days ago -->
|
||||
<!-- numpythia: 34, last pushed 7 days ago -->
|
||||
<!-- power-grid-model: 34, last pushed 0 days ago -->
|
||||
<!-- pyjet: 33, last pushed 7 days ago -->
|
||||
<!-- pillow-heif: 28, last pushed 1 days ago -->
|
||||
<!-- pybind11 scikit_build_example: 27, last pushed 7 days ago -->
|
||||
<!-- ninja: 24, last pushed 1 days ago -->
|
||||
<!-- GSD: 19, last pushed 14 days ago -->
|
||||
<!-- pyinstrument_cext: 10, last pushed 249 days ago -->
|
||||
<!-- xmlstarlet: 9, last pushed 1 days ago -->
|
||||
<!-- CorrectionLib: 9, last pushed 7 days ago -->
|
||||
<!-- SiPM: 6, last pushed 14 days ago -->
|
||||
<!-- Wrapt: 1689, last pushed 56 days ago -->
|
||||
<!-- PyAV: 1591, last pushed 1 days ago -->
|
||||
<!-- SimpleJSON: 1495, last pushed 65 days ago -->
|
||||
<!-- pikepdf: 1356, last pushed 2 days ago -->
|
||||
<!-- OpenColorIO: 1327, last pushed 5 days ago -->
|
||||
<!-- Line Profiler: 1262, last pushed 3 days ago -->
|
||||
<!-- PyTables: 1133, last pushed 68 days ago -->
|
||||
<!-- OpenTimelineIO: 1067, last pushed 0 days ago -->
|
||||
<!-- ruptures: 979, last pushed 40 days ago -->
|
||||
<!-- aioquic: 966, last pushed 1 days ago -->
|
||||
<!-- DeepForest: 763, last pushed 43 days ago -->
|
||||
<!-- google neuroglancer: 739, last pushed 3 days ago -->
|
||||
<!-- Psycopg 3: 704, last pushed 2 days ago -->
|
||||
<!-- Parselmouth: 668, last pushed 3 days ago -->
|
||||
<!-- AutoPy: 658, last pushed 183 days ago -->
|
||||
<!-- H3-py: 539, last pushed 18 days ago -->
|
||||
<!-- Rtree: 483, last pushed 68 days ago -->
|
||||
<!-- markupsafe: 474, last pushed 13 days ago -->
|
||||
<!-- python-rapidjson: 454, last pushed 32 days ago -->
|
||||
<!-- python-snappy: 438, last pushed 102 days ago -->
|
||||
<!-- pybind11 cmake_example: 415, last pushed 9 days ago -->
|
||||
<!-- KDEpy: 379, last pushed 136 days ago -->
|
||||
<!-- tgcalls: 369, last pushed 22 days ago -->
|
||||
<!-- pybind11 python_example: 333, last pushed 6 days ago -->
|
||||
<!-- dd-trace-py: 331, last pushed 0 days ago -->
|
||||
<!-- sourmash: 310, last pushed 1 days ago -->
|
||||
<!-- CTranslate2: 306, last pushed 3 days ago -->
|
||||
<!-- time-machine: 306, last pushed 2 days ago -->
|
||||
<!-- cyvcf2: 300, last pushed 37 days ago -->
|
||||
<!-- matrixprofile: 268, last pushed 12 days ago -->
|
||||
<!-- abess: 266, last pushed 1 days ago -->
|
||||
<!-- jq.py: 219, last pushed 140 days ago -->
|
||||
<!-- iminuit: 206, last pushed 4 days ago -->
|
||||
<!-- Tokenizer: 187, last pushed 111 days ago -->
|
||||
<!-- PyGLM: 144, last pushed 90 days ago -->
|
||||
<!-- boost-histogram: 115, last pushed 3 days ago -->
|
||||
<!-- bx-python: 113, last pushed 172 days ago -->
|
||||
<!-- iDynTree: 106, last pushed 3 days ago -->
|
||||
<!-- TgCrypto: 105, last pushed 114 days ago -->
|
||||
<!-- Python-WebRTC: 91, last pushed 108 days ago -->
|
||||
<!-- pybase64: 84, last pushed 3 days ago -->
|
||||
<!-- Arbor: 76, last pushed 2 days ago -->
|
||||
<!-- fathon: 63, last pushed 24 days ago -->
|
||||
<!-- etebase-py: 58, last pushed 10 days ago -->
|
||||
<!-- Imagecodecs (fork): 46, last pushed 11 days ago -->
|
||||
<!-- polaroid: 41, last pushed 46 days ago -->
|
||||
<!-- clang-format: 40, last pushed 13 days ago -->
|
||||
<!-- numpythia: 34, last pushed 6 days ago -->
|
||||
<!-- power-grid-model: 34, last pushed 1 days ago -->
|
||||
<!-- pyjet: 33, last pushed 5 days ago -->
|
||||
<!-- pillow-heif: 30, last pushed 0 days ago -->
|
||||
<!-- pybind11 scikit_build_example: 27, last pushed 6 days ago -->
|
||||
<!-- ninja: 24, last pushed 6 days ago -->
|
||||
<!-- GSD: 19, last pushed 3 days ago -->
|
||||
<!-- pyinstrument_cext: 10, last pushed 261 days ago -->
|
||||
<!-- xmlstarlet: 9, last pushed 13 days ago -->
|
||||
<!-- CorrectionLib: 9, last pushed 6 days ago -->
|
||||
<!-- SiPM: 6, last pushed 25 days ago -->
|
||||
|
||||
<!-- END bin/projects.py -->
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@ console_scripts =
|
||||
cibuildwheel = resources/*
|
||||
|
||||
[flake8]
|
||||
extend-ignore = E203,E501,B950
|
||||
extend-select = B,B9
|
||||
extend-ignore = E203,E501,B950,B023
|
||||
extend-select = B9
|
||||
application-import-names = cibuildwheel
|
||||
exclude =
|
||||
cibuildwheel/resources/,
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
import textwrap
|
||||
|
||||
from . import test_projects, utils
|
||||
|
||||
limited_api_project = test_projects.new_c_project(
|
||||
setup_py_add=textwrap.dedent(
|
||||
r"""
|
||||
cmdclass = {}
|
||||
extension_kwargs = {}
|
||||
if sys.version_info[:2] >= (3, 8):
|
||||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
|
||||
|
||||
class bdist_wheel_abi3(_bdist_wheel):
|
||||
def finalize_options(self):
|
||||
_bdist_wheel.finalize_options(self)
|
||||
self.root_is_pure = False
|
||||
|
||||
def get_tag(self):
|
||||
python, abi, plat = _bdist_wheel.get_tag(self)
|
||||
return python, "abi3", plat
|
||||
|
||||
cmdclass["bdist_wheel"] = bdist_wheel_abi3
|
||||
extension_kwargs["define_macros"] = [("Py_LIMITED_API", "0x03080000")]
|
||||
extension_kwargs["py_limited_api"] = True
|
||||
"""
|
||||
),
|
||||
setup_py_extension_args_add="**extension_kwargs",
|
||||
setup_py_setup_args_add="cmdclass=cmdclass",
|
||||
)
|
||||
|
||||
|
||||
def test_abi3(tmp_path):
|
||||
project_dir = tmp_path / "project"
|
||||
limited_api_project.generate(project_dir)
|
||||
|
||||
# build the wheels
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_SKIP": "pp* ", # PyPy does not have a Py_LIMITED_API equivalent
|
||||
},
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [
|
||||
w.replace("cp38-cp38", "cp38-abi3")
|
||||
for w in utils.expected_wheels("spam", "0.1.0")
|
||||
if "-pp" not in w and "-cp39" not in w and "-cp310" not in w and "-cp311" not in w
|
||||
]
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
|
||||
ctypes_project = test_projects.TestProject()
|
||||
ctypes_project.files["setup.py"] = textwrap.dedent(
|
||||
"""
|
||||
from setuptools import setup, Extension
|
||||
|
||||
from distutils.command.build_ext import build_ext as _build_ext
|
||||
class CTypesExtension(Extension): pass
|
||||
class build_ext(_build_ext):
|
||||
def build_extension(self, ext):
|
||||
self._ctypes = isinstance(ext, CTypesExtension)
|
||||
return super().build_extension(ext)
|
||||
|
||||
def get_export_symbols(self, ext):
|
||||
if self._ctypes:
|
||||
return ext.export_symbols
|
||||
return super().get_export_symbols(ext)
|
||||
|
||||
def get_ext_filename(self, ext_name):
|
||||
if self._ctypes:
|
||||
return ext_name + '.so'
|
||||
return super().get_ext_filename(ext_name)
|
||||
|
||||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
|
||||
class bdist_wheel_abi_none(_bdist_wheel):
|
||||
def finalize_options(self):
|
||||
_bdist_wheel.finalize_options(self)
|
||||
self.root_is_pure = False
|
||||
|
||||
def get_tag(self):
|
||||
python, abi, plat = _bdist_wheel.get_tag(self)
|
||||
return "py3", "none", plat
|
||||
|
||||
setup(
|
||||
name="ctypesexample",
|
||||
version="1.0.0",
|
||||
py_modules = ["ctypesexample.summing"],
|
||||
ext_modules=[
|
||||
CTypesExtension(
|
||||
"ctypesexample.csumlib",
|
||||
["ctypesexample/csumlib.c"],
|
||||
),
|
||||
],
|
||||
cmdclass={'build_ext': build_ext, 'bdist_wheel': bdist_wheel_abi_none},
|
||||
)
|
||||
"""
|
||||
)
|
||||
ctypes_project.files["ctypesexample/csumlib.c"] = textwrap.dedent(
|
||||
"""
|
||||
#ifdef _WIN32
|
||||
#define LIBRARY_API __declspec(dllexport)
|
||||
#else
|
||||
#define LIBRARY_API
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
LIBRARY_API double *add_vec3(double *a, double *b)
|
||||
{
|
||||
double *res = malloc(sizeof(double) * 3);
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
res[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
"""
|
||||
)
|
||||
ctypes_project.files["ctypesexample/summing.py"] = textwrap.dedent(
|
||||
"""
|
||||
import ctypes
|
||||
import pathlib
|
||||
|
||||
# path of the shared library
|
||||
libfile = pathlib.Path(__file__).parent / "csumlib.so"
|
||||
csumlib = ctypes.CDLL(str(libfile))
|
||||
|
||||
type_vec3 = ctypes.POINTER(ctypes.c_double * 3)
|
||||
|
||||
csumlib.add_vec3.restype = type_vec3
|
||||
csumlib.add_vec3.argtypes = [type_vec3, type_vec3]
|
||||
def add(a: list, b: list) -> list:
|
||||
a_p = (ctypes.c_double * 3)(*a)
|
||||
b_p = (ctypes.c_double * 3)(*b)
|
||||
r_p = csumlib.add_vec3(a_p,b_p)
|
||||
|
||||
return [l for l in r_p.contents]
|
||||
"""
|
||||
)
|
||||
|
||||
ctypes_project.files["test/add_test.py"] = textwrap.dedent(
|
||||
"""
|
||||
import ctypesexample.summing
|
||||
|
||||
def test():
|
||||
a = [1, 2, 3]
|
||||
b = [4, 5, 6]
|
||||
assert ctypesexample.summing.add(a, b) == [5, 7, 9]
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def test_abi_none(tmp_path, capfd):
|
||||
project_dir = tmp_path / "project"
|
||||
ctypes_project.generate(project_dir)
|
||||
|
||||
# build the wheels
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_TEST_REQUIRES": "pytest",
|
||||
"CIBW_TEST_COMMAND": "pytest {project}/test",
|
||||
# limit the number of builds for test performance reasons
|
||||
"CIBW_BUILD": "cp38-* cp310-* pp39-*",
|
||||
},
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = utils.expected_wheels("ctypesexample", "1.0.0", python_abi_tags=["py3-none"])
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
|
||||
# check that each wheel was built once, and reused
|
||||
captured = capfd.readouterr()
|
||||
assert "Building wheel..." in captured.out
|
||||
assert "Found previously built wheel" in captured.out
|
||||
@@ -1,50 +0,0 @@
|
||||
import textwrap
|
||||
|
||||
from . import test_projects, utils
|
||||
|
||||
limited_api_project = test_projects.new_c_project(
|
||||
setup_py_add=textwrap.dedent(
|
||||
r"""
|
||||
cmdclass = {}
|
||||
extension_kwargs = {}
|
||||
if sys.version_info[:2] >= (3, 8):
|
||||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
|
||||
|
||||
class bdist_wheel_abi3(_bdist_wheel):
|
||||
def finalize_options(self):
|
||||
_bdist_wheel.finalize_options(self)
|
||||
self.root_is_pure = False
|
||||
|
||||
def get_tag(self):
|
||||
python, abi, plat = _bdist_wheel.get_tag(self)
|
||||
return python, "abi3", plat
|
||||
|
||||
cmdclass["bdist_wheel"] = bdist_wheel_abi3
|
||||
extension_kwargs["define_macros"] = [("Py_LIMITED_API", "0x03080000")]
|
||||
extension_kwargs["py_limited_api"] = True
|
||||
"""
|
||||
),
|
||||
setup_py_extension_args_add="**extension_kwargs",
|
||||
setup_py_setup_args_add="cmdclass=cmdclass",
|
||||
)
|
||||
|
||||
|
||||
def test(tmp_path):
|
||||
project_dir = tmp_path / "project"
|
||||
limited_api_project.generate(project_dir)
|
||||
|
||||
# build the wheels
|
||||
actual_wheels = utils.cibuildwheel_run(
|
||||
project_dir,
|
||||
add_env={
|
||||
"CIBW_SKIP": "pp* ", # PyPy does not have a Py_LIMITED_API equivalent
|
||||
},
|
||||
)
|
||||
|
||||
# check that the expected wheels are produced
|
||||
expected_wheels = [
|
||||
w.replace("cp38-cp38", "cp38-abi3")
|
||||
for w in utils.expected_wheels("spam", "0.1.0")
|
||||
if "-pp" not in w and "-cp39" not in w and "-cp310" not in w and "-cp311" not in w
|
||||
]
|
||||
assert set(actual_wheels) == set(expected_wheels)
|
||||
+18
-16
@@ -113,6 +113,7 @@ def expected_wheels(
|
||||
musllinux_versions=None,
|
||||
macosx_deployment_target="10.9",
|
||||
machine_arch=None,
|
||||
python_abi_tags=None,
|
||||
):
|
||||
"""
|
||||
Returns a list of expected wheels from a run of cibuildwheel.
|
||||
@@ -139,21 +140,22 @@ def expected_wheels(
|
||||
if musllinux_versions is None:
|
||||
musllinux_versions = ["musllinux_1_1"]
|
||||
|
||||
python_abi_tags = [
|
||||
"cp36-cp36m",
|
||||
"cp37-cp37m",
|
||||
"cp38-cp38",
|
||||
"cp39-cp39",
|
||||
"cp310-cp310",
|
||||
"cp311-cp311",
|
||||
]
|
||||
if python_abi_tags is None:
|
||||
python_abi_tags = [
|
||||
"cp36-cp36m",
|
||||
"cp37-cp37m",
|
||||
"cp38-cp38",
|
||||
"cp39-cp39",
|
||||
"cp310-cp310",
|
||||
"cp311-cp311",
|
||||
]
|
||||
|
||||
if machine_arch in ["x86_64", "AMD64", "x86", "aarch64"]:
|
||||
python_abi_tags += ["pp37-pypy37_pp73", "pp38-pypy38_pp73", "pp39-pypy39_pp73"]
|
||||
if machine_arch in ["x86_64", "AMD64", "x86", "aarch64"]:
|
||||
python_abi_tags += ["pp37-pypy37_pp73", "pp38-pypy38_pp73", "pp39-pypy39_pp73"]
|
||||
|
||||
if platform == "macos" and machine_arch == "arm64":
|
||||
# currently, arm64 macs are only supported by cp39, cp310 & cp311
|
||||
python_abi_tags = ["cp39-cp39", "cp310-cp310", "cp311-cp311"]
|
||||
if platform == "macos" and machine_arch == "arm64":
|
||||
# currently, arm64 macs are only supported by cp39, cp310 & cp311
|
||||
python_abi_tags = ["cp39-cp39", "cp310-cp310", "cp311-cp311"]
|
||||
|
||||
wheels = []
|
||||
|
||||
@@ -185,10 +187,10 @@ def expected_wheels(
|
||||
)
|
||||
|
||||
elif platform == "windows":
|
||||
if python_abi_tag.startswith("cp"):
|
||||
platform_tags = ["win32", "win_amd64"]
|
||||
else:
|
||||
if python_abi_tag.startswith("pp"):
|
||||
platform_tags = ["win_amd64"]
|
||||
else:
|
||||
platform_tags = ["win32", "win_amd64"]
|
||||
|
||||
elif platform == "macos":
|
||||
if python_abi_tag == "cp39-cp39" and machine_arch == "arm64":
|
||||
|
||||
+10
-10
@@ -4,15 +4,15 @@ from cibuildwheel.options import CommandLineArguments
|
||||
|
||||
|
||||
def get_default_command_line_arguments() -> CommandLineArguments:
|
||||
defaults = CommandLineArguments()
|
||||
|
||||
defaults.platform = "auto"
|
||||
defaults.allow_empty = False
|
||||
defaults.archs = None
|
||||
defaults.config_file = ""
|
||||
defaults.output_dir = Path("wheelhouse")
|
||||
defaults.package_dir = Path(".")
|
||||
defaults.prerelease_pythons = False
|
||||
defaults.print_build_identifiers = False
|
||||
defaults = CommandLineArguments(
|
||||
platform="auto",
|
||||
allow_empty=False,
|
||||
archs=None,
|
||||
config_file="",
|
||||
output_dir=Path("wheelhouse"),
|
||||
package_dir=Path("."),
|
||||
prerelease_pythons=False,
|
||||
print_build_identifiers=False,
|
||||
)
|
||||
|
||||
return defaults
|
||||
|
||||
Reference in New Issue
Block a user