Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ repos:
files: '^(README\.md|docs/changelog\.md|docs/options\.md|bin/readme.*)$'
additional_dependencies: [cogapp>=3.5]

- repo: https://github.com/henryiii/flake8-lazy
rev: 65b94e97b1091634368592d98072160842265fe4 # frozen: v0.8.2
hooks:
- id: flake8-lazy
args: ["--apply=set"]
files: '^cibuildwheel'
exclude: "^cibuildwheel/resources/"

- repo: https://github.com/codespell-project/codespell
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2
hooks:
Expand Down
25 changes: 25 additions & 0 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
from __future__ import annotations

__lazy_modules__ = {
"argparse",
"cibuildwheel._compat",
"cibuildwheel._compat.tarfile",
"cibuildwheel.architecture",
"cibuildwheel.ci",
"cibuildwheel.logger",
"cibuildwheel.options",
"cibuildwheel.platforms",
"cibuildwheel.selector",
"cibuildwheel.typing",
"cibuildwheel.util",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.resources",
"contextlib",
"functools",
"io",
"pathlib",
"shutil",
"tempfile",
"textwrap",
"traceback",
}

import argparse
import contextlib
import dataclasses
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/architecture.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"platform", "re", "shutil", "subprocess"}

import platform as platform_module
import re
import shutil
Expand Down
11 changes: 11 additions & 0 deletions cibuildwheel/audit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"pathlib",
"subprocess",
}

import subprocess
import sys
from pathlib import Path
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/bashlex_eval.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"bashlex", "subprocess"}

import dataclasses
import subprocess

Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/ci.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__lazy_modules__ = {"cibuildwheel.util", "cibuildwheel.util.helpers"}

import os
import re
from enum import Enum
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/environment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"bashlex", "bashlex.errors"}

import dataclasses
from typing import Protocol

Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
semantically clear and unique.
"""

__lazy_modules__ = {"textwrap"}

import textwrap


Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from __future__ import annotations

__lazy_modules__ = {"io", "json", "urllib", "urllib.error", "urllib.request"}

import json
import time
import typing
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/frontend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"cibuildwheel.util", "cibuildwheel.util.helpers", "shlex"}

import dataclasses
import shlex
import typing
Expand Down
12 changes: 12 additions & 0 deletions cibuildwheel/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.ci",
"contextlib",
"functools",
"hashlib",
"humanize",
"io",
"pathlib",
"re",
"textwrap",
}

import codecs
import contextlib
import dataclasses
Expand Down
18 changes: 18 additions & 0 deletions cibuildwheel/oci_container.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.ci",
"cibuildwheel.errors",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.helpers",
"contextlib",
"io",
"json",
"platform",
"shlex",
"shutil",
"subprocess",
"textwrap",
"uuid",
}

import contextlib
import dataclasses
import io
Expand Down
24 changes: 24 additions & 0 deletions cibuildwheel/options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.architecture",
"cibuildwheel.environment",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.oci_container",
"cibuildwheel.projectfiles",
"cibuildwheel.selector",
"cibuildwheel.typing",
"cibuildwheel.util",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"collections",
"configparser",
"contextlib",
"difflib",
"packaging",
"packaging.specifiers",
"pathlib",
"shlex",
"textwrap",
"tomllib",
}

import collections
import configparser
import contextlib
Expand Down
28 changes: 28 additions & 0 deletions cibuildwheel/platforms/android.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
from __future__ import annotations

__lazy_modules__ = {
"build",
"build.env",
"cibuildwheel.architecture",
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.util.python_build_standalone",
"cibuildwheel.venv",
"filelock",
"packaging",
"packaging.utils",
"pathlib",
"platform",
"pprint",
"re",
"runpy",
"shlex",
"shutil",
"subprocess",
"textwrap",
"typing",
}

import os
import platform
import re
Expand Down
23 changes: 23 additions & 0 deletions cibuildwheel/platforms/ios.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.platforms.macos",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"filelock",
"packaging",
"packaging.version",
"pathlib",
"platform",
"shlex",
"shutil",
"subprocess",
"textwrap",
"typing",
}

import dataclasses
import os
import platform
Expand Down
17 changes: 17 additions & 0 deletions cibuildwheel/platforms/linux.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"collections",
"contextlib",
"pathlib",
"shutil",
"subprocess",
"textwrap",
"typing",
}

import contextlib
import dataclasses
import shutil
Expand Down
22 changes: 22 additions & 0 deletions cibuildwheel/platforms/macos.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.audit",
"cibuildwheel.ci",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"filelock",
"inspect",
"packaging",
"packaging.version",
"pathlib",
"platform",
"re",
"shutil",
"subprocess",
}

import dataclasses
import functools
import inspect
Expand Down
21 changes: 21 additions & 0 deletions cibuildwheel/platforms/pyodide.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.architecture",
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.util.python_build_standalone",
"cibuildwheel.venv",
"filelock",
"json",
"pathlib",
"shutil",
"subprocess",
"tempfile",
"tomllib",
}

import dataclasses
import functools
import json
Expand Down
20 changes: 20 additions & 0 deletions cibuildwheel/platforms/windows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
from __future__ import annotations

__lazy_modules__ = {
"cibuildwheel.architecture",
"cibuildwheel.audit",
"cibuildwheel.frontend",
"cibuildwheel.logger",
"cibuildwheel.util",
"cibuildwheel.util.cmd",
"cibuildwheel.util.file",
"cibuildwheel.util.helpers",
"cibuildwheel.util.packaging",
"cibuildwheel.venv",
"filelock",
"pathlib",
"platform",
"shutil",
"subprocess",
"textwrap",
"typing",
}

import dataclasses
import os
import platform as platform_module
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/projectfiles.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"configparser", "contextlib", "dependency_groups"}

import ast
import configparser
import contextlib
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/schema.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"cibuildwheel.util", "json"}

import json

from cibuildwheel.util import resources
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/selector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"bracex", "fnmatch", "itertools", "packaging", "packaging.version"}

import dataclasses
import itertools
from enum import StrEnum
Expand Down
2 changes: 2 additions & 0 deletions cibuildwheel/util/cmd.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

__lazy_modules__ = {"cibuildwheel.errors", "shlex", "shutil", "subprocess"}

import os
import shlex
import shutil
Expand Down
Loading
Loading