Skip to content

Commit 2cafd21

Browse files
committed
Drop Python 3.5
1 parent 0a20669 commit 2cafd21

File tree

12 files changed

+12
-160
lines changed

12 files changed

+12
-160
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ 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 3.5 || ||||||||
2827
| CPython 3.6 || ||||||||
2928
| CPython 3.7 || ||||||||
3029
| CPython 3.8 || ||||||||

bin/update_dependencies.py

Lines changed: 1 addition & 1 deletion
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 = ["35", "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:

cibuildwheel/macos.py

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,6 @@ def get_python_configurations(
111111
c for c in python_configurations if not c.identifier.startswith("pp")
112112
]
113113

114-
if any(c.identifier.startswith("cp35") for c in python_configurations):
115-
# CPython 3.5 doesn't work on macOS 11
116-
log.warning(
117-
unwrap(
118-
"""
119-
CPython 3.5 is unsupported when building on macOS 11. To build CPython 3.5
120-
wheels, build on an older OS, such as macOS 10.15. To silence this warning,
121-
deselect CPython 3.5 by adding "cp35-macosx_x86_64" to your CIBW_SKIP option.
122-
"""
123-
)
124-
)
125-
python_configurations = [
126-
c for c in python_configurations if not c.identifier.startswith("cp35")
127-
]
128-
129114
return python_configurations
130115

131116

@@ -164,21 +149,6 @@ def install_cpython(version: str, url: str) -> Path:
164149
download(url, Path("/tmp/Python.pkg"))
165150
# install
166151
call(["sudo", "installer", "-pkg", "/tmp/Python.pkg", "-target", "/"])
167-
# patch open ssl
168-
if version == "3.5":
169-
open_ssl_patch_url = f"https://github.com/mayeut/patch-macos-python-openssl/releases/download/v1.1.1h/patch-macos-python-{version}-openssl-v1.1.1h.tar.gz"
170-
download(open_ssl_patch_url, Path("/tmp/python-patch.tar.gz"))
171-
call(
172-
[
173-
"sudo",
174-
"tar",
175-
"-C",
176-
f"/Library/Frameworks/Python.framework/Versions/{version}/",
177-
"-xmf",
178-
"/tmp/python-patch.tar.gz",
179-
]
180-
)
181-
182152
call(["sudo", str(installation_bin_path / python_executable), str(install_certifi_script)])
183153

184154
pip_executable = "pip3"
@@ -278,20 +248,12 @@ def setup_python(
278248
sys.exit(1)
279249

280250
# Set MACOSX_DEPLOYMENT_TARGET to 10.9, if the user didn't set it.
281-
# CPython 3.5 defaults to 10.6, and pypy defaults to 10.7, causing
282-
# inconsistencies if it's left unset.
251+
# PyPy defaults to 10.7, causing inconsistencies if it's left unset.
283252
env.setdefault("MACOSX_DEPLOYMENT_TARGET", "10.9")
284253

285254
config_is_arm64 = python_configuration.identifier.endswith("arm64")
286255
config_is_universal2 = python_configuration.identifier.endswith("universal2")
287256

288-
if python_configuration.version == "3.5":
289-
# Cross-compilation platform override - CPython 3.5 has an
290-
# i386/x86_64 version of Python, but we only want a x64_64 build
291-
env.setdefault("_PYTHON_HOST_PLATFORM", "macosx-10.9-x86_64")
292-
# https://github.com/python/cpython/blob/a5ed2fe0eedefa1649aa93ee74a0bafc8e628a10/Lib/_osx_support.py#L260
293-
env.setdefault("ARCHFLAGS", "-arch x86_64")
294-
295257
if python_configuration.version == "3.9":
296258
if python_configuration.identifier.endswith("x86_64"):
297259
# even on the macos11.0 Python installer, on the x86_64 side it's

cibuildwheel/resources/build-platforms.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
[linux]
22
python_configurations = [
3-
{ identifier = "cp35-manylinux_x86_64", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
43
{ identifier = "cp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
54
{ identifier = "cp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
65
{ identifier = "cp38-manylinux_x86_64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
76
{ identifier = "cp39-manylinux_x86_64", version = "3.9", path_str = "/opt/python/cp39-cp39" },
8-
{ identifier = "cp35-manylinux_i686", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
97
{ identifier = "cp36-manylinux_i686", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
108
{ identifier = "cp37-manylinux_i686", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
119
{ identifier = "cp38-manylinux_i686", version = "3.8", path_str = "/opt/python/cp38-cp38" },
1210
{ identifier = "cp39-manylinux_i686", version = "3.9", path_str = "/opt/python/cp39-cp39" },
1311
{ identifier = "pp36-manylinux_x86_64", version = "3.6", path_str = "/opt/python/pp36-pypy36_pp73" },
1412
{ identifier = "pp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
15-
{ identifier = "cp35-manylinux_aarch64", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
1613
{ identifier = "cp36-manylinux_aarch64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
1714
{ identifier = "cp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
1815
{ identifier = "cp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
1916
{ identifier = "cp39-manylinux_aarch64", version = "3.9", path_str = "/opt/python/cp39-cp39" },
20-
{ identifier = "cp35-manylinux_ppc64le", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
2117
{ identifier = "cp36-manylinux_ppc64le", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
2218
{ identifier = "cp37-manylinux_ppc64le", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
2319
{ identifier = "cp38-manylinux_ppc64le", version = "3.8", path_str = "/opt/python/cp38-cp38" },
2420
{ identifier = "cp39-manylinux_ppc64le", version = "3.9", path_str = "/opt/python/cp39-cp39" },
25-
{ identifier = "cp35-manylinux_s390x", version = "3.5", path_str = "/opt/python/cp35-cp35m" },
2621
{ identifier = "cp36-manylinux_s390x", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
2722
{ identifier = "cp37-manylinux_s390x", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
2823
{ identifier = "cp38-manylinux_s390x", version = "3.8", path_str = "/opt/python/cp38-cp38" },
@@ -31,7 +26,6 @@ python_configurations = [
3126

3227
[macos]
3328
python_configurations = [
34-
{ identifier = "cp35-macosx_x86_64", version = "3.5", url = "https://www.python.org/ftp/python/3.5.4/python-3.5.4-macosx10.6.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" },
@@ -44,8 +38,6 @@ python_configurations = [
4438

4539
[windows]
4640
python_configurations = [
47-
{ identifier = "cp35-win32", version = "3.5.4", arch = "32" },
48-
{ identifier = "cp35-win_amd64", version = "3.5.4", arch = "64" },
4941
{ identifier = "cp36-win32", version = "3.6.8", arch = "32" },
5042
{ identifier = "cp36-win_amd64", version = "3.6.8", arch = "64" },
5143
{ identifier = "cp37-win32", version = "3.7.9", arch = "32" },

cibuildwheel/resources/constraints-python35.txt

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

cibuildwheel/windows.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from typing import Dict, List, NamedTuple, Optional, Sequence, Set
88
from zipfile import ZipFile
99

10-
import toml
11-
1210
from .architecture import Architecture
1311
from .environment import ParsedEnvironment
1412
from .logger import log
@@ -209,34 +207,6 @@ def setup_python(
209207
return env
210208

211209

212-
def pep_518_cp35_workaround(package_dir: Path, env: Dict[str, str]) -> None:
213-
"""
214-
Python 3.5 PEP 518 hack (see https://github.com/pypa/pip/issues/8392#issuecomment-639563494)
215-
Basically, nuget's Python is an embedded Python distribution, which is not supported by pip.
216-
Before version 3.6, there was no way to disable the "embedded" behavior, including the ignoring
217-
of environment variables, including the ones pip uses to setup PEP 518 builds.
218-
219-
The fix here is as suggested in that issue; we manually setup the PEP 518 requirements. Since we
220-
are in a fresh environment (except for pinned cibuildweel dependencies), the build is already
221-
mostly "isolated".
222-
"""
223-
224-
pyproject_path = package_dir / "pyproject.toml"
225-
226-
if pyproject_path.exists():
227-
data = toml.load(pyproject_path)
228-
requirements = data["build-system"].get("requires", []) if "build-system" in data else []
229-
230-
if requirements:
231-
log.step("Performing PEP518 workaround...")
232-
with tempfile.TemporaryDirectory() as d:
233-
reqfile = Path(d) / "requirements.txt"
234-
with reqfile.open("w") as f:
235-
for r in requirements:
236-
print(r, file=f)
237-
call(["pip", "install", "-r", reqfile], env=env)
238-
239-
240210
def build(options: BuildOptions) -> None:
241211
temp_dir = Path(tempfile.mkdtemp(prefix="cibuildwheel"))
242212
built_wheel_dir = temp_dir / "built_wheel"
@@ -276,11 +246,6 @@ def build(options: BuildOptions) -> None:
276246
)
277247
shell(before_build_prepared, env=env)
278248

279-
# activate the PEP 518 patch if on Windows Python 3.5
280-
# (will only have an effect if PEP 517 builds are used):
281-
if config.version.startswith("3.5"):
282-
pep_518_cp35_workaround(options.package_dir, env)
283-
284249
log.step("Building wheel...")
285250
if built_wheel_dir.exists():
286251
shutil.rmtree(built_wheel_dir)

docs/contributing.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ This has been moved to using docker, so you only need the following instructions
7171
The dependency update script in the next section requires multiple python versions installed. One way to do this is to use `pyenv`:
7272

7373
```bash
74-
pyenv install 3.5.9
7574
pyenv install 3.6.11
7675
pyenv install 3.7.8
7776
# Optionally add 3.8 and make it the local version;
@@ -81,7 +80,6 @@ pyenv install 3.7.8
8180
Then, you need to make the required virtual environments:
8281

8382
```bash
84-
$(pyenv prefix 3.5.9)/bin/python -m venv env35
8583
$(pyenv prefix 3.6.11)/bin/python -m venv env36
8684
$(pyenv prefix 3.7.8)/bin/python -m venv env37
8785
```

docs/options.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This option can also be set using the [command-line option](#command-line) `--pl
110110

111111
> Choose the Python versions to build
112112
113-
Space-separated list of builds to build and skip. Each build has an identifier like `cp27-manylinux_x86_64` or `cp35-macosx_x86_64` - you can list specific ones to build and cibuildwheel will only build those, and/or list ones to skip and cibuildwheel won't try to build them.
113+
Space-separated list of builds to build and skip. Each build has an identifier like `cp38-manylinux_x86_64` or `cp37-macosx_x86_64` - you can list specific ones to build and cibuildwheel will only build those, and/or list ones to skip and cibuildwheel won't try to build them.
114114

115115
When both options are specified, both conditions are applied and only builds with a tag that matches `CIBW_BUILD` and does not match `CIBW_SKIP` will be built.
116116

@@ -120,7 +120,6 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat
120120

121121
| | macOS | Windows | Manylinux Intel | Manylinux Other |
122122
|--------------|---------------------------------------------------------------------|-------------------------------|-----------------------------------------------|----------------------------------------------------------------------------|
123-
| Python 3.5 | cp35-macosx_x86_64 | cp35-win_amd64<br/>cp35-win32 | cp35-manylinux_x86_64<br/>cp35-manylinux_i686 | cp35-manylinux_aarch64<br/>cp35-manylinux_ppc64le<br/>cp35-manylinux_s390x |
124123
| Python 3.6 | cp36-macosx_x86_64 | cp36-win_amd64<br/>cp36-win32 | cp36-manylinux_x86_64<br/>cp36-manylinux_i686 | cp36-manylinux_aarch64<br/>cp36-manylinux_ppc64le<br/>cp36-manylinux_s390x |
125124
| Python 3.7 | cp37-macosx_x86_64 | cp37-win_amd64<br/>cp37-win32 | cp37-manylinux_x86_64<br/>cp37-manylinux_i686 | cp37-manylinux_aarch64<br/>cp37-manylinux_ppc64le<br/>cp37-manylinux_s390x |
126125
| Python 3.8 | cp38-macosx_x86_64 | cp38-win_amd64<br/>cp38-win32 | cp38-manylinux_x86_64<br/>cp38-manylinux_i686 | cp38-manylinux_aarch64<br/>cp38-manylinux_ppc64le<br/>cp38-manylinux_s390x |
@@ -155,8 +154,8 @@ CIBW_SKIP: cp36-win*
155154
# Skip CPython 3.6 on 32-bit Windows
156155
CIBW_SKIP: cp36-win32
157156

158-
# Skip CPython 3.5 and CPython 3.6
159-
CIBW_SKIP: cp35-* cp36-*
157+
# Skip CPython 3.6 and CPython 3.7
158+
CIBW_SKIP: cp36-* cp37-*
160159

161160
# Skip Python 3.6 on Linux
162161
CIBW_SKIP: cp36-manylinux*

docs/setup.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ To build Linux, Mac, and Windows wheels on Azure Pipelines, create a `azure-pipe
109109
{% include "../examples/azure-pipelines-minimal.yml" %}
110110
```
111111

112-
!!! note
113-
To support Python 3.5 on Windows, make sure to specify the use of `{vmImage: 'vs2017-win2016'}` on Windows, to ensure the required toolchain is available.
114-
115112
Commit this file, enable building of your repo on Azure Pipelines, and push.
116113

117114
Wheels will be stored for you and available through the Pipelines interface. For more info on this file, check out the [docs](https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema).

test/test_dependency_versions.py

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,17 @@ def get_versions_from_constraint_file(constraint_file):
4747
}
4848

4949

50-
@pytest.mark.parametrize("python_version", ["3.5", "3.6", "3.8", "3.9"])
50+
@pytest.mark.parametrize("python_version", ["3.6", "3.8", "3.9"])
5151
def test_pinned_versions(tmp_path, python_version):
5252
if utils.platform == "linux":
5353
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead")
5454

55-
is_macos_11_or_later = utils.platform == "macos" and utils.get_macos_version() >= (10, 16)
56-
57-
if is_macos_11_or_later and python_version == "3.5":
58-
pytest.skip("CPython 3.5 doesn't work on macOS Big Sur+")
59-
6055
project_dir = tmp_path / "project"
6156
project_with_expected_version_checks.generate(project_dir)
6257

6358
build_environment = {}
6459

65-
if python_version == "3.5":
66-
constraint_filename = "constraints-python35.txt"
67-
build_pattern = "[cp]p35-*"
68-
elif python_version == "3.6":
60+
if python_version == "3.6":
6961
constraint_filename = "constraints-python36.txt"
7062
build_pattern = "[cp]p36-*"
7163
elif python_version == "3.7":
@@ -97,11 +89,7 @@ def test_pinned_versions(tmp_path, python_version):
9789
)
9890

9991
# also check that we got the right wheels
100-
if python_version == "3.5":
101-
expected_wheels = [
102-
w for w in utils.expected_wheels("spam", "0.1.0") if "-cp35" in w or "-pp35" in w
103-
]
104-
elif python_version == "3.6":
92+
if python_version == "3.6":
10593
expected_wheels = [
10694
w for w in utils.expected_wheels("spam", "0.1.0") if "-cp36" in w or "-pp36" in w
10795
]
@@ -119,8 +107,7 @@ def test_pinned_versions(tmp_path, python_version):
119107
assert set(actual_wheels) == set(expected_wheels)
120108

121109

122-
@pytest.mark.parametrize("python_version", ["3.5", "3.x"])
123-
def test_dependency_constraints_file(tmp_path, python_version):
110+
def test_dependency_constraints_file(tmp_path):
124111
if utils.platform == "linux":
125112
pytest.skip("linux doesn't pin individual tool versions, it pins manylinux images instead")
126113

@@ -129,7 +116,7 @@ def test_dependency_constraints_file(tmp_path, python_version):
129116

130117
tool_versions = {
131118
"pip": "20.0.2",
132-
"setuptools": "50.3.2" if python_version == "3.5" else "53.0.0",
119+
"setuptools": "53.0.0",
133120
"wheel": "0.34.2",
134121
"virtualenv": "20.0.10",
135122
}
@@ -160,17 +147,11 @@ def test_dependency_constraints_file(tmp_path, python_version):
160147
actual_wheels = utils.cibuildwheel_run(
161148
project_dir,
162149
add_env={
163-
"CIBW_BUILD": "cp35-*" if python_version == "3.5" else "[cp]p3?-*",
164-
"CIBW_SKIP": "" if python_version == "3.5" else "cp35-*",
165150
"CIBW_ENVIRONMENT": cibw_environment_option,
166151
"CIBW_DEPENDENCY_VERSIONS": str(constraints_file),
167152
},
168153
)
169154

170155
# also check that we got the right wheels
171-
if python_version == "3.5":
172-
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "-cp35" in w]
173-
else:
174-
expected_wheels = [w for w in utils.expected_wheels("spam", "0.1.0") if "-cp35" not in w]
175-
156+
expected_wheels = utils.expected_wheels("spam", "0.1.0")
176157
assert set(actual_wheels) == set(expected_wheels)

0 commit comments

Comments
 (0)