Fix misaligned triple-quote blocks
This commit is contained in:
@@ -52,10 +52,10 @@ def main():
|
||||
shell('git commit -a -m "Update dependencies"', check=True)
|
||||
body = textwrap.dedent(
|
||||
f'''
|
||||
Update the versions of our dependencies.
|
||||
Update the versions of our dependencies.
|
||||
|
||||
PR generated by `{os.path.basename(__file__)}`.
|
||||
'''
|
||||
PR generated by `{os.path.basename(__file__)}`.
|
||||
'''
|
||||
)
|
||||
run(
|
||||
[
|
||||
|
||||
+25
-25
@@ -79,13 +79,13 @@ def main() -> None:
|
||||
choices=['auto', 'linux', 'macos', 'windows'],
|
||||
default=os.environ.get('CIBW_PLATFORM', 'auto'),
|
||||
help='''
|
||||
Platform to build for. For "linux" you need docker running, on Mac
|
||||
or Linux. For "macos", you need a Mac machine, and note that this
|
||||
script is going to automatically install MacPython on your system,
|
||||
so don't run on your development machine. For "windows", you need to
|
||||
run in Windows, and it will build and test for all versions of
|
||||
Python. Default: auto.
|
||||
''',
|
||||
Platform to build for. For "linux" you need docker running, on Mac
|
||||
or Linux. For "macos", you need a Mac machine, and note that this
|
||||
script is going to automatically install MacPython on your system,
|
||||
so don't run on your development machine. For "windows", you need to
|
||||
run in Windows, and it will build and test for all versions of
|
||||
Python. Default: auto.
|
||||
''',
|
||||
)
|
||||
|
||||
arch_list_str = ", ".join(a.name for a in Architecture)
|
||||
@@ -93,13 +93,13 @@ def main() -> None:
|
||||
'--archs',
|
||||
default=None,
|
||||
help=f'''
|
||||
Comma-separated list of CPU architectures to build for.
|
||||
When set to 'auto', builds the architectures natively supported
|
||||
on this machine. Set this option to build an architecture
|
||||
via emulation, for example, using binfmt_misc and QEMU.
|
||||
Default: auto.
|
||||
Choices: auto, auto64, auto32, native, all, {arch_list_str}
|
||||
''',
|
||||
Comma-separated list of CPU architectures to build for.
|
||||
When set to 'auto', builds the architectures natively supported
|
||||
on this machine. Set this option to build an architecture
|
||||
via emulation, for example, using binfmt_misc and QEMU.
|
||||
Default: auto.
|
||||
Choices: auto, auto64, auto32, native, all, {arch_list_str}
|
||||
''',
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@@ -113,11 +113,11 @@ def main() -> None:
|
||||
default='.',
|
||||
nargs='?',
|
||||
help='''
|
||||
Path to the package that you want wheels for. Must be a subdirectory of
|
||||
the working directory. When set, the working directory is still
|
||||
considered the 'project' and is copied into the Docker container on
|
||||
Linux. Default: the working directory.
|
||||
''',
|
||||
Path to the package that you want wheels for. Must be a subdirectory of
|
||||
the working directory. When set, the working directory is still
|
||||
considered the 'project' and is copied into the Docker container on
|
||||
Linux. Default: the working directory.
|
||||
''',
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@@ -148,7 +148,7 @@ def main() -> None:
|
||||
Travis CI, AppVeyor, Azure Pipelines, GitHub Actions, CircleCI, and Gitlab are
|
||||
supported. You can run on your development machine or other CI providers using the
|
||||
--platform argument. Check --help output for more information.
|
||||
'''
|
||||
'''
|
||||
),
|
||||
file=sys.stderr,
|
||||
)
|
||||
@@ -387,11 +387,11 @@ def print_preamble(platform: str, build_options: BuildOptions) -> None:
|
||||
print(
|
||||
textwrap.dedent(
|
||||
'''
|
||||
_ _ _ _ _ _ _
|
||||
___|_| |_ _ _|_| |_| |_ _ _| |_ ___ ___| |
|
||||
| _| | . | | | | | . | | | | | -_| -_| |
|
||||
|___|_|___|___|_|_|___|_____|_|_|___|___|_|
|
||||
'''
|
||||
_ _ _ _ _ _ _
|
||||
___|_| |_ _ _|_| |_| |_ _ _| |_ ___ ___| |
|
||||
| _| | . | | | | | . | | | | | -_| -_| |
|
||||
|___|_|___|___|_|_|___|_____|_|_|___|___|_|
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -319,14 +319,14 @@ def troubleshoot(package_dir: Path, error: Exception) -> None:
|
||||
print(
|
||||
textwrap.dedent(
|
||||
'''
|
||||
NOTE: Shared object (.so) files found in this project.
|
||||
NOTE: Shared object (.so) files found in this project.
|
||||
|
||||
These files might be built against the wrong OS, causing problems with
|
||||
auditwheel.
|
||||
These files might be built against the wrong OS, causing problems with
|
||||
auditwheel.
|
||||
|
||||
If you're using Cython and have previously done an in-place build,
|
||||
remove those build files (*.so and *.c) before starting cibuildwheel.
|
||||
'''
|
||||
If you're using Cython and have previously done an in-place build,
|
||||
remove those build files (*.so and *.c) before starting cibuildwheel.
|
||||
'''
|
||||
),
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
+22
-20
@@ -101,10 +101,10 @@ def get_python_configurations(
|
||||
log.warning(
|
||||
unwrap(
|
||||
'''
|
||||
PyPy is currently unsupported when building on macOS 11. To build macOS PyPy wheels,
|
||||
build on an older OS, such as macOS 10.15. To silence this warning, deselect PyPy by
|
||||
adding "pp*-macosx*" to your CIBW_SKIP option.
|
||||
'''
|
||||
PyPy is currently unsupported when building on macOS 11. To build macOS PyPy
|
||||
wheels, build on an older OS, such as macOS 10.15. To silence this warning,
|
||||
deselect PyPy by adding "pp*-macosx*" to your CIBW_SKIP option.
|
||||
'''
|
||||
)
|
||||
)
|
||||
python_configurations = [
|
||||
@@ -116,10 +116,10 @@ def get_python_configurations(
|
||||
log.warning(
|
||||
unwrap(
|
||||
'''
|
||||
CPython 3.5 is unsupported when building on macOS 11. To build CPython 3.5 wheels,
|
||||
build on an older OS, such as macOS 10.15. To silence this warning, deselect CPython
|
||||
3.5 by adding "cp35-macosx_x86_64" to your CIBW_SKIP option.
|
||||
'''
|
||||
CPython 3.5 is unsupported when building on macOS 11. To build CPython 3.5
|
||||
wheels, build on an older OS, such as macOS 10.15. To silence this warning,
|
||||
deselect CPython 3.5 by adding "cp35-macosx_x86_64" to your CIBW_SKIP option.
|
||||
'''
|
||||
)
|
||||
)
|
||||
python_configurations = [
|
||||
@@ -326,7 +326,7 @@ def setup_python(
|
||||
'''
|
||||
SDK for building arm64-compatible wheels not found. You need Xcode 12.2 or later
|
||||
to build universal2 or arm64 wheels.
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
else:
|
||||
@@ -465,23 +465,25 @@ def build(options: BuildOptions) -> None:
|
||||
log.warning(
|
||||
unwrap(
|
||||
'''
|
||||
While arm64 wheels can be built on x86_64, they cannot be tested. The
|
||||
ability to test the arm64 wheels will be added in a future release of
|
||||
cibuildwheel, once Apple Silicon CI runners are widely available. To
|
||||
silence this warning, set `CIBW_TEST_SKIP: *-macosx_arm64`.
|
||||
'''
|
||||
While arm64 wheels can be built on x86_64, they cannot be
|
||||
tested. The ability to test the arm64 wheels will be added in a
|
||||
future release of cibuildwheel, once Apple Silicon CI runners
|
||||
are widely available. To silence this warning, set
|
||||
`CIBW_TEST_SKIP: *-macosx_arm64`.
|
||||
'''
|
||||
)
|
||||
)
|
||||
elif config_is_universal2:
|
||||
log.warning(
|
||||
unwrap(
|
||||
'''
|
||||
While universal2 wheels can be built on x86_64, the arm64 part of them
|
||||
cannot currently be tested. The ability to test the arm64 part of a
|
||||
universal2 wheel will be added in a future release of cibuildwheel, once
|
||||
Apple Silicon CI runners are widely available. To silence this warning,
|
||||
set `CIBW_TEST_SKIP: *-macosx_universal2:arm64`.
|
||||
'''
|
||||
While universal2 wheels can be built on x86_64, the arm64 part
|
||||
of them cannot currently be tested. The ability to test the
|
||||
arm64 part of a universal2 wheel will be added in a future
|
||||
release of cibuildwheel, once Apple Silicon CI runners are
|
||||
widely available. To silence this warning, set
|
||||
`CIBW_TEST_SKIP: *-macosx_universal2:arm64`.
|
||||
'''
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -206,7 +206,7 @@ class NonPlatformWheelError(Exception):
|
||||
|
||||
If you expected a platform wheel, check your project configuration, or run
|
||||
cibuildwheel with CIBW_BUILD_VERBOSITY=1 to view build logs.
|
||||
'''
|
||||
'''
|
||||
)
|
||||
|
||||
super().__init__(message)
|
||||
|
||||
@@ -14,7 +14,7 @@ basic_project = test_projects.new_c_project(
|
||||
|
||||
if os.environ.get("CIBUILDWHEEL", "0") != "1":
|
||||
raise Exception("CIBUILDWHEEL environment variable is not set to 1")
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ project_with_before_build_asserts = test_projects.new_c_project(
|
||||
|
||||
print("## stored text: " + stored_text)
|
||||
assert stored_text == "sample text 123"
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ project_with_before_build_asserts = test_projects.new_c_project(
|
||||
print('sys.executable', sys.executable)
|
||||
# windows/mac are case insensitive
|
||||
assert os.path.realpath(stored_executable).lower() == os.path.realpath(sys.executable).lower()
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ project_with_skip_asserts = test_projects.new_c_project(
|
||||
raise Exception("Python 2.7 should not be built")
|
||||
if sys.version_info[0:2] == (3, 7):
|
||||
raise Exception("Python 3.7 should be skipped")
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from .test_projects import TestProject
|
||||
|
||||
cpp_test_project = TestProject()
|
||||
|
||||
setup_py_template = r'''\
|
||||
setup_py_template = r'''
|
||||
from setuptools import Extension, setup
|
||||
|
||||
setup(
|
||||
@@ -18,7 +18,7 @@ setup(
|
||||
)
|
||||
'''
|
||||
|
||||
spam_cpp_template = r'''\
|
||||
spam_cpp_template = r'''
|
||||
#include <Python.h>
|
||||
|
||||
{{ spam_cpp_top_level_add }}
|
||||
|
||||
@@ -31,7 +31,7 @@ project_with_expected_version_checks = test_projects.new_c_project(
|
||||
assert '{}=={}'.format(package_name, expected_version) in versions, (
|
||||
'error: {} version should equal {}'.format(package_name, expected_version)
|
||||
)
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
@@ -148,7 +148,7 @@ def test_dependency_constraints_file(tmp_path, python_version):
|
||||
setuptools=={setuptools}
|
||||
wheel=={wheel}
|
||||
virtualenv=={virtualenv}
|
||||
'''.format(
|
||||
'''.format(
|
||||
**tool_versions
|
||||
)
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ dockcross_only_project = test_projects.new_c_project(
|
||||
raise Exception(
|
||||
"/dockcross directory not found. Is this test running in the correct docker image?"
|
||||
)
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ project_with_environment_asserts = test_projects.new_c_project(
|
||||
raise Exception('PATH should contain "/opt/cibw_test_path". It was "%s"' % PATH)
|
||||
if "$PATH" in PATH:
|
||||
raise Exception('$PATH should be expanded in PATH. It was "%s"' % PATH)
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ project_with_manylinux_symbols = test_projects.new_c_project(
|
||||
#if !__GLIBC_PREREQ(2, 5) /* manylinux1 is glibc 2.5 */
|
||||
#error "Must run on a glibc >= 2.5 linux environment"
|
||||
#endif
|
||||
'''
|
||||
'''
|
||||
),
|
||||
spam_c_function_add=textwrap.dedent(
|
||||
r'''
|
||||
@@ -35,7 +35,7 @@ project_with_manylinux_symbols = test_projects.new_c_project(
|
||||
// malloc_info is only available on manylinux2010+
|
||||
sts = malloc_info(0, stdout);
|
||||
#endif
|
||||
'''
|
||||
'''
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -13,22 +13,16 @@ def main():
|
||||
parser.add_argument(
|
||||
'--open',
|
||||
action='store_true',
|
||||
help='''
|
||||
Open the generated project in a file explorer
|
||||
''',
|
||||
help='Open the generated project in a file explorer',
|
||||
)
|
||||
parser.add_argument(
|
||||
'PROJECT',
|
||||
help='''
|
||||
Python path to a project object. E.g. test.test_0_basic.basic_project
|
||||
''',
|
||||
help='Python path to a project object. E.g. test.test_0_basic.basic_project',
|
||||
)
|
||||
parser.add_argument(
|
||||
'OUTPUT',
|
||||
nargs='?',
|
||||
help='''
|
||||
Path to output dir. If no dir is passed, a tempdir will be generated.
|
||||
''',
|
||||
help='Path to output dir. If no dir is passed, a tempdir will be generated.',
|
||||
)
|
||||
options = parser.parse_args()
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ project_with_ssl_tests = test_projects.new_c_project(
|
||||
data = urlopen("https://www.nist.gov", context=context)
|
||||
data = urlopen("https://raw.githubusercontent.com/joerick/cibuildwheel/master/CI.md", context=context)
|
||||
data = urlopen("https://raw.githubusercontent.com/joerick/cibuildwheel/master/CI.md")
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ project_with_a_test = test_projects.new_c_project(
|
||||
r'''
|
||||
[options.extras_require]
|
||||
test = nose
|
||||
'''
|
||||
'''
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ project_with_unicode = test_projects.new_c_project(
|
||||
{
|
||||
Py_XDECREF(PyUnicode_FromStringAndSize("foo", 4));
|
||||
}
|
||||
'''
|
||||
'''
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -107,9 +107,9 @@ def test_binary_output():
|
||||
'-c',
|
||||
textwrap.dedent(
|
||||
'''
|
||||
import sys
|
||||
sys.stdout.write(''.join(chr(n) for n in range(0, 256)))
|
||||
'''
|
||||
import sys
|
||||
sys.stdout.write(''.join(chr(n) for n in range(0, 256)))
|
||||
'''
|
||||
),
|
||||
]
|
||||
)
|
||||
@@ -121,9 +121,9 @@ def test_binary_output():
|
||||
'-c',
|
||||
textwrap.dedent(
|
||||
'''
|
||||
import sys
|
||||
sys.stdout.write(''.join(chr(n % 256) for n in range(0, 512)))
|
||||
'''
|
||||
import sys
|
||||
sys.stdout.write(''.join(chr(n % 256) for n in range(0, 512)))
|
||||
'''
|
||||
),
|
||||
],
|
||||
capture_output=True,
|
||||
|
||||
@@ -53,9 +53,9 @@ def test_override_setup_cfg(platform, monkeypatch, intercepted_build_args, fake_
|
||||
fake_package_dir.joinpath("setup.cfg").write_text(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
[options]
|
||||
python_requires = >=3.8
|
||||
"""
|
||||
[options]
|
||||
python_requires = >=3.8
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -74,9 +74,9 @@ def test_override_pyproject_toml(platform, monkeypatch, intercepted_build_args,
|
||||
fake_package_dir.joinpath("pyproject.toml").write_text(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
[project]
|
||||
requires-python = ">=3.8"
|
||||
"""
|
||||
[project]
|
||||
requires-python = ">=3.8"
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -95,13 +95,13 @@ def test_override_setup_py_simple(platform, monkeypatch, intercepted_build_args,
|
||||
fake_package_dir.joinpath("setup.py").write_text(
|
||||
textwrap.dedent(
|
||||
"""
|
||||
from setuptools import setup
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name = "other",
|
||||
python_requires = ">=3.7",
|
||||
)
|
||||
"""
|
||||
setup(
|
||||
name = "other",
|
||||
python_requires = ">=3.7",
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ def test_read_setup_py_simple(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
from setuptools import setup
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = "1.23",
|
||||
)
|
||||
"""
|
||||
setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = "1.23",
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -29,17 +29,17 @@ def test_read_setup_py_full(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
import setuptools
|
||||
import setuptools
|
||||
|
||||
setuptools.randomfunc()
|
||||
setuptools.randomfunc()
|
||||
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = "1.24",
|
||||
)
|
||||
"""
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = "1.24",
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -52,17 +52,17 @@ def test_read_setup_py_assign(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
from setuptools import setup
|
||||
from setuptools import setup
|
||||
|
||||
REQUIRES = "3.21"
|
||||
REQUIRES = "3.21"
|
||||
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = REQUIRES,
|
||||
)
|
||||
"""
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = REQUIRES,
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -75,17 +75,17 @@ def test_read_setup_py_None(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
from setuptools import setup
|
||||
from setuptools import setup
|
||||
|
||||
REQUIRES = None
|
||||
REQUIRES = None
|
||||
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = None,
|
||||
)
|
||||
"""
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
python_requires = None,
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -98,16 +98,16 @@ def test_read_setup_py_empty(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
from setuptools import setup
|
||||
from setuptools import setup
|
||||
|
||||
REQUIRES = "3.21"
|
||||
REQUIRES = "3.21"
|
||||
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
)
|
||||
"""
|
||||
setuptools.setup(
|
||||
name = "hello",
|
||||
other = 23,
|
||||
example = ["item", "other"],
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -120,11 +120,11 @@ def test_read_setup_cfg(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
[options]
|
||||
python_requires = 1.234
|
||||
[metadata]
|
||||
something = other
|
||||
"""
|
||||
[options]
|
||||
python_requires = 1.234
|
||||
[metadata]
|
||||
something = other
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -136,11 +136,11 @@ def test_read_setup_cfg_empty(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
[options]
|
||||
other = 1.234
|
||||
[metadata]
|
||||
something = other
|
||||
"""
|
||||
[options]
|
||||
other = 1.234
|
||||
[metadata]
|
||||
something = other
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -152,12 +152,12 @@ def test_read_pyproject_toml(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
[project]
|
||||
requires-python = "1.654"
|
||||
[project]
|
||||
requires-python = "1.654"
|
||||
|
||||
[tool.cibuildwheel]
|
||||
something = "other"
|
||||
"""
|
||||
[tool.cibuildwheel]
|
||||
something = "other"
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
@@ -169,9 +169,9 @@ def test_read_pyproject_toml_empty(tmp_path):
|
||||
f.write(
|
||||
dedent(
|
||||
"""
|
||||
[project]
|
||||
other = 1.234
|
||||
"""
|
||||
[project]
|
||||
other = 1.234
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user