Skip to content

Commit 04fab96

Browse files
committed
Fix build with the latest Python 3.9 and 3.10 versions
We used the web installer getting headers and `python3.lib`. It looks like it's been removed for the latest versions in favor of the full offline installer or individual `.msi` files. Downloading only the specific `dev.msi` file directly is even easier than getting it via the web installer, so let's do that instead.
1 parent 94b3fc1 commit 04fab96

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.github/workflows/test_package.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
os: [windows-latest, ubuntu-latest, macos-latest]
11-
embedded-py: [3.8.10, 3.9.9]
11+
embedded-py: [3.8.10, 3.10.4]
1212
env:
1313
create_pck: conan create . lumicks/testing -o embedded_python:version=${{ matrix.embedded-py }} --build=missing
1414
steps:

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.4.4 | In development
4+
5+
- Fixed build with Python >= 3.9.11 and >= 3.10.3 on Windows (the installer changed)
6+
37
## v1.4.3 | 2022-01-28
48

59
- Worked around a CPython issue that prevented compilation of Python < 3.9.8 with clang 13: https://bugs.python.org/issue45405

conanfile.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# noinspection PyUnresolvedReferences
77
class EmbeddedPython(ConanFile):
88
name = "embedded_python"
9-
version = "1.4.3" # of the Conan package, `options.version` is the Python version
9+
version = "1.4.4" # of the Conan package, `options.version` is the Python version
1010
license = "PSFL"
1111
description = "Embedded distribution of Python"
1212
topics = "embedded", "python"
@@ -168,9 +168,8 @@ def _get_binaries(self, dest_dir):
168168

169169
def _get_headers_and_lib(self, dest_dir):
170170
"""We also need headers and the `python3.lib` file to link against"""
171-
url = "https://www.python.org/ftp/python/{0}/python-{0}-amd64-webinstall.exe"
172-
tools.download(url.format(self.conanfile.pyversion), filename="tmp\\installer.exe")
173-
self.conanfile.run("tmp\\installer.exe /quiet /layout")
171+
url = f"https://www.python.org/ftp/python/{self.conanfile.pyversion}/amd64/dev.msi"
172+
tools.download(url, filename="tmp\\dev.msi")
174173
build_folder = self.conanfile.build_folder
175174
self.conanfile.run(f"msiexec.exe /a {build_folder}\\tmp\\dev.msi targetdir={dest_dir}")
176175
tools.rmdir("tmp")

0 commit comments

Comments
 (0)