Skip to content

Commit 3e22cd9

Browse files
mayeuthenryiii
authored andcommitted
Drop Python 2.7
1 parent bf31d18 commit 3e22cd9

28 files changed

+146
-507
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@ What does it do?
2424

2525
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux i686 | manylinux aarch64 | manylinux ppc64le | manylinux s390x |
2626
|---|---|---|---|---|---|---|---|---|---|
27-
| CPython 2.7 || | ✅¹ | ✅¹ ||| | | |
2827
| CPython 3.6 || ||||||||
2928
| CPython 3.7 || ||||||||
3029
| CPython 3.8 || ||||||||
3130
| CPython 3.9 ||||||||||
32-
| PyPy 2.7 v7.3.3 || | ||| | | | |
3331
| PyPy 3.6 v7.3.3 || | ||| | | | |
3432
| PyPy 3.7 (beta) v7.3.3 || | ||| | | | |
3533

36-
<sup>¹ Only using a workaround with a newer compiler; Microsoft removed the 2008 compiler for Python 2.7 in April 2021.</sup><br>
37-
3834
- Builds manylinux, macOS 10.9+, and Windows wheels for CPython and PyPy
3935
- Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI
4036
- Bundles shared library dependencies on Linux and macOS through [auditwheel](https://github.com/pypa/auditwheel) and [delocate](https://github.com/matthew-brett/delocate)
4137
- Runs your library's tests against the wheel-installed version of your library
4238

39+
See the [cibuildwheel 1 documentation](https://cibuildwheel.readthedocs.io/en/1.x/) if you need to build unsupported versions of Python, such as Python 2.
40+
4341
Usage
4442
-----
4543

@@ -98,7 +96,7 @@ jobs:
9896
path: ./wheelhouse/*.whl
9997
```
10098
101-
For more information, including building on Python 2, PyPI deployment, and the use of other CI services or the dedicated GitHub Action, check out the [documentation](https://cibuildwheel.readthedocs.org) and the [examples](https://github.com/joerick/cibuildwheel/tree/master/examples).
99+
For more information, including PyPI deployment, and the use of other CI services or the dedicated GitHub Action, check out the [documentation](https://cibuildwheel.readthedocs.org) and the [examples](https://github.com/joerick/cibuildwheel/tree/master/examples).
102100
103101
Options
104102
-------

bin/update_dependencies.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# regenerate the constraints files
1818
os.environ["CUSTOM_COMPILE_COMMAND"] = "bin/update_dependencies.py"
1919

20-
PYTHON_VERSIONS = ["27", "36", "37", "38", "39"]
20+
PYTHON_VERSIONS = ["36", "37", "38", "39"]
2121

2222
if "--no-docker" in sys.argv:
2323
for python_version in PYTHON_VERSIONS:
@@ -32,8 +32,7 @@
3232
check=True,
3333
)
3434
else:
35-
# latest manylinux2010 image with cpython 2.7 support
36-
image_runner = "quay.io/pypa/manylinux2010_x86_64:2021-02-06-3d322a5"
35+
image_runner = "quay.io/pypa/manylinux2010_x86_64:latest"
3736
subprocess.run(["docker", "pull", image_runner], check=True)
3837
for python_version in PYTHON_VERSIONS:
3938
abi_flags = "" if int(python_version) >= 38 else "m"
@@ -77,9 +76,9 @@ class Image(NamedTuple):
7776
images = [
7877
Image("manylinux1", "x86_64", "quay.io/pypa/manylinux1_x86_64", None),
7978
Image("manylinux1", "i686", "quay.io/pypa/manylinux1_i686", None),
80-
# Images for manylinux2010 are pinned to the latest tag supporting cp27
81-
Image("manylinux2010", "x86_64", "quay.io/pypa/manylinux2010_x86_64", "2021-02-06-3d322a5"),
82-
Image("manylinux2010", "i686", "quay.io/pypa/manylinux2010_i686", "2021-02-06-3d322a5"),
79+
# 2010 images
80+
Image("manylinux2010", "x86_64", "quay.io/pypa/manylinux2010_x86_64", None),
81+
Image("manylinux2010", "i686", "quay.io/pypa/manylinux2010_i686", None),
8382
Image("manylinux2010", "pypy_x86_64", "pypywheels/manylinux2010-pypy_x86_64", None),
8483
# 2014 images
8584
Image("manylinux2014", "x86_64", "quay.io/pypa/manylinux2014_x86_64", None),

cibuildwheel/linux.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ def build(options: BuildOptions) -> None:
124124
dependency_constraint_flags: List[PathOrStr] = []
125125
if config.identifier.startswith("pp"):
126126
# Patch PyPy to make sure headers get installed into a venv
127-
patch_version = "_27" if config.version == "2.7" else ""
128-
patch_path = resources_dir / f"pypy_venv{patch_version}.patch"
127+
patch_path = resources_dir / "pypy_venv.patch"
129128
patch_docker_path = PurePath("/pypy_venv.patch")
130129
docker.copy_into(patch_path, patch_docker_path)
131130
try:

cibuildwheel/macos.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def install_cpython(version: str, url: str) -> Path:
141141

142142
# if this version of python isn't installed, get it from python.org and install
143143
python_package_identifier = f"org.python.Python.PythonFramework-{version}"
144-
python_executable = "python3" if version[0] == "3" else "python"
144+
python_executable = "python3"
145145
installation_bin_path = Path(f"/Library/Frameworks/Python.framework/Versions/{version}/bin")
146146

147147
if python_package_identifier not in installed_system_packages:
@@ -151,7 +151,7 @@ def install_cpython(version: str, url: str) -> Path:
151151
call(["sudo", "installer", "-pkg", "/tmp/Python.pkg", "-target", "/"])
152152
call(["sudo", str(installation_bin_path / python_executable), str(install_certifi_script)])
153153

154-
pip_executable = "pip3" if version[0] == "3" else "pip"
154+
pip_executable = "pip3"
155155
make_symlinks(installation_bin_path, python_executable, pip_executable)
156156

157157
return installation_bin_path
@@ -168,13 +168,12 @@ def install_pypy(version: str, url: str) -> Path:
168168
download(url, downloaded_tar_bz2)
169169
call(["tar", "-C", "/tmp", "-xf", downloaded_tar_bz2])
170170
# Patch PyPy to make sure headers get installed into a venv
171-
patch_version = "_27" if version == "2.7" else ""
172-
patch_path = resources_dir / f"pypy_venv{patch_version}.patch"
171+
patch_path = resources_dir / "pypy_venv.patch"
173172
call(["patch", "--force", "-p1", "-d", installation_path, "-i", patch_path])
174173

175174
installation_bin_path = installation_path / "bin"
176-
python_executable = "pypy3" if version[0] == "3" else "pypy"
177-
pip_executable = "pip3" if version[0] == "3" else "pip"
175+
python_executable = "pypy3"
176+
pip_executable = "pip3"
178177
make_symlinks(installation_bin_path, python_executable, pip_executable)
179178

180179
return installation_bin_path

cibuildwheel/resources/build-platforms.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
[linux]
22
python_configurations = [
3-
{ identifier = "cp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/cp27-cp27m" },
4-
{ identifier = "cp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/cp27-cp27mu" },
53
{ identifier = "cp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
64
{ identifier = "cp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
75
{ identifier = "cp38-manylinux_x86_64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
86
{ identifier = "cp39-manylinux_x86_64", version = "3.9", path_str = "/opt/python/cp39-cp39" },
9-
{ identifier = "cp27-manylinux_i686", version = "2.7", path_str = "/opt/python/cp27-cp27m" },
10-
{ identifier = "cp27-manylinux_i686", version = "2.7", path_str = "/opt/python/cp27-cp27mu" },
117
{ identifier = "cp36-manylinux_i686", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
128
{ identifier = "cp37-manylinux_i686", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
139
{ identifier = "cp38-manylinux_i686", version = "3.8", path_str = "/opt/python/cp38-cp38" },
1410
{ identifier = "cp39-manylinux_i686", version = "3.9", path_str = "/opt/python/cp39-cp39" },
15-
{ identifier = "pp27-manylinux_x86_64", version = "2.7", path_str = "/opt/python/pp27-pypy_73" },
1611
{ identifier = "pp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/pp36-pypy36_pp73" },
1712
{ identifier = "pp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
1813
{ identifier = "cp36-manylinux_aarch64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
@@ -31,22 +26,18 @@ python_configurations = [
3126

3227
[macos]
3328
python_configurations = [
34-
{ identifier = "cp27-macosx_x86_64", version = "2.7", url = "https://www.python.org/ftp/python/2.7.18/python-2.7.18-macosx10.9.pkg" },
3529
{ identifier = "cp36-macosx_x86_64", version = "3.6", url = "https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg" },
3630
{ identifier = "cp37-macosx_x86_64", version = "3.7", url = "https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg" },
3731
{ identifier = "cp38-macosx_x86_64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.9/python-3.8.9-macosx10.9.pkg" },
3832
{ identifier = "cp39-macosx_x86_64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.4/python-3.9.4-macos11.pkg" },
3933
{ identifier = "cp39-macosx_arm64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.4/python-3.9.4-macos11.pkg" },
4034
{ identifier = "cp39-macosx_universal2", version = "3.9", url = "https://www.python.org/ftp/python/3.9.4/python-3.9.4-macos11.pkg" },
41-
{ identifier = "pp27-macosx_x86_64", version = "2.7", url = "https://downloads.python.org/pypy/pypy2.7-v7.3.3-osx64.tar.bz2" },
4235
{ identifier = "pp36-macosx_x86_64", version = "3.6", url = "https://downloads.python.org/pypy/pypy3.6-v7.3.3-osx64.tar.bz2" },
4336
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.3-osx64.tar.bz2" },
4437
]
4538

4639
[windows]
4740
python_configurations = [
48-
{ identifier = "cp27-win32", version = "2.7.18", arch = "32" },
49-
{ identifier = "cp27-win_amd64", version = "2.7.18", arch = "64" },
5041
{ identifier = "cp36-win32", version = "3.6.8", arch = "32" },
5142
{ identifier = "cp36-win_amd64", version = "3.6.8", arch = "64" },
5243
{ identifier = "cp37-win32", version = "3.7.9", arch = "32" },
@@ -55,7 +46,6 @@ python_configurations = [
5546
{ identifier = "cp38-win_amd64", version = "3.8.9", arch = "64" },
5647
{ identifier = "cp39-win32", version = "3.9.4", arch = "32" },
5748
{ identifier = "cp39-win_amd64", version = "3.9.4", arch = "64" },
58-
{ identifier = "pp27-win32", version = "2.7", arch = "32", url = "https://downloads.python.org/pypy/pypy2.7-v7.3.3-win32.zip" },
5949
{ identifier = "pp36-win32", version = "3.6", arch = "32", url = "https://downloads.python.org/pypy/pypy3.6-v7.3.3-win32.zip" },
6050
{ identifier = "pp37-win32", version = "3.7", arch = "32", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.3-win32.zip" },
6151
]

cibuildwheel/resources/constraints-python27.txt

Lines changed: 0 additions & 55 deletions
This file was deleted.

cibuildwheel/resources/install_certifi.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
| stat.S_IXOTH
2525
)
2626

27-
if sys.version_info[0] == 2:
28-
FileNotFoundError = OSError
29-
3027

3128
def main():
3229
openssl_dir, openssl_cafile = os.path.split(ssl.get_default_verify_paths().openssl_cafile)

cibuildwheel/resources/pinned_docker_images.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[x86_64]
22
manylinux1 = quay.io/pypa/manylinux1_x86_64:2021-04-05-14df3a6
3-
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-02-06-3d322a5
3+
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-04-05-b4fd19d
44
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-04-05-b4fd19d
55
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-04-05-b4fd19d
66

77
[i686]
88
manylinux1 = quay.io/pypa/manylinux1_i686:2021-04-05-14df3a6
9-
manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-02-06-3d322a5
9+
manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-04-05-b4fd19d
1010
manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-04-05-b4fd19d
1111
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-04-05-b4fd19d
1212

cibuildwheel/resources/pypy_venv_27.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

cibuildwheel/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def get_for_python_version(self, version: str) -> Path:
163163
version_parts = version.split(".")
164164

165165
# try to find a version-specific dependency file e.g. if
166-
# ./constraints.txt is the base, look for ./constraints-python27.txt
166+
# ./constraints.txt is the base, look for ./constraints-python36.txt
167167
specific_stem = self.base_file_path.stem + f"-python{version_parts[0]}{version_parts[1]}"
168168
specific_name = specific_stem + self.base_file_path.suffix
169169
specific_file_path = self.base_file_path.with_name(specific_name)

0 commit comments

Comments
 (0)