Skip to content

Commit bff7d33

Browse files
committed
Drop support for Conan v1
1 parent 2e205a5 commit bff7d33

File tree

7 files changed

+19
-105
lines changed

7 files changed

+19
-105
lines changed

.github/workflows/test_package.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,26 @@ jobs:
88
matrix:
99
os: [windows-latest, ubuntu-latest, macos-latest]
1010
embedded-py: [3.11.5, 3.12.4]
11-
conan:
12-
- version: 1
13-
args: lumicks/testing --build=missing
14-
- version: 2
15-
args: --user=lumicks --channel=testing --build=missing
16-
name: "${{ matrix.os }}, ${{ matrix.embedded-py }}, v${{ matrix.conan.version }}"
11+
name: "${{ matrix.os }}, ${{ matrix.embedded-py }}"
1712
env:
18-
create_pck: conan create . ${{ matrix.conan.args }} -o embedded_python-core/*:version=${{ matrix.embedded-py }}
13+
create_pck: conan create . -o embedded_python-core/*:version=${{ matrix.embedded-py }} --build=missing --user=lumicks --channel=testing
1914
steps:
2015
- uses: actions/checkout@v4
2116
- name: Set up Python
2217
uses: actions/setup-python@v5
2318
with:
24-
python-version: "3.11"
19+
python-version: "3.12"
2520
- if: runner.os == 'macOS'
2621
name: Set up CC/CXX env
2722
run: |
2823
echo CC=/usr/bin/clang >> $GITHUB_ENV
2924
echo CXX=/usr/bin/clang++ >> $GITHUB_ENV
30-
- if: matrix.conan.version == '1'
31-
name: Install Conan v1
32-
run: |
33-
python -m pip install conan==1.64.1
34-
conan profile new default --detect
35-
- if: matrix.conan.version == '2'
36-
name: Install Conan v2
25+
- name: Install Conan
3726
run: |
38-
python -m pip install conan==2.4.1
27+
python -m pip install conan==2.9.2
3928
conan profile detect
4029
- name: Test core
41-
run: conan create ./core ${{ matrix.conan.args }} -o embedded_python-core/*:version=${{ matrix.embedded-py }}
30+
run: cd core && ${{ env.create_pck }}
4231
- name: Test baseline
4332
run: ${{ env.create_pck }}
4433
- name: Test with numpy env

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.10.0 | TBD
4+
5+
- Dropped support for Conan v1.
6+
37
## v1.9.1 | 2024-06-17
48

59
- Fixed an issue where calling CMake with `-DPython_EXECUTABLE=<system_python>` created conflicts with the embedded Python (either a loud version error, or silently passing the wrong library paths). Some IDEs would pass this flag implicitly and it would hijack the `find_package(Python)` call used internally by this recipe. Now, we specifically protect against this since there should be no traces of system Python in a project that wishes to embed it.

conanfile.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from conan import ConanFile
55
from conan.tools import files, scm
66

7-
required_conan_version = ">=1.59.0"
7+
required_conan_version = ">=2.5.0"
88

99

1010
# noinspection PyUnresolvedReferences
1111
class EmbeddedPython(ConanFile):
1212
name = "embedded_python"
13-
version = "1.9.1" # of the Conan package, `embedded_python-core:version` is the Python version
13+
version = "1.10.0" # of the Conan package, `embedded_python-core:version` is the Python version
1414
license = "PSFL"
1515
description = "Embedded distribution of Python"
1616
topics = "embedded", "python"
@@ -31,11 +31,10 @@ class EmbeddedPython(ConanFile):
3131
"setuptools_version": "69.5.1",
3232
"wheel_version": "0.43.0",
3333
}
34-
short_paths = True # some of the pip packages go over the 260 char path limit on Windows
3534
exports_sources = "embedded_python.cmake"
3635

3736
def requirements(self):
38-
self.requires(f"embedded_python-core/1.3.1@{self.user}/{self.channel}")
37+
self.requires(f"embedded_python-core/1.4.0@{self.user}/{self.channel}")
3938

4039
@property
4140
def pyversion(self):
@@ -202,9 +201,7 @@ def package(self):
202201
self._gather_packages(license_folder)
203202

204203
def package_info(self):
205-
self.env_info.PYTHONPATH.append(self.package_folder)
206204
self.cpp_info.set_property("cmake_build_modules", ["embedded_python.cmake"])
207-
self.cpp_info.build_modules = ["embedded_python.cmake"]
208205
self.cpp_info.includedirs = []
209206
self.cpp_info.bindirs = []
210207
self.cpp_info.libdirs = []

core/conanfile.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
from conan.errors import ConanInvalidConfiguration
88
from conan.tools import files, scm
99

10-
required_conan_version = ">=1.59.0"
10+
required_conan_version = ">=2.5"
1111

1212

1313
# noinspection PyUnresolvedReferences
1414
class EmbeddedPythonCore(ConanFile):
1515
name = "embedded_python-core"
16-
version = "1.3.1" # of the Conan package, `options.version` is the Python version
16+
version = "1.4.0" # of the Conan package, `options.version` is the Python version
1717
license = "PSFL"
1818
description = "The core embedded Python (no extra pip packages)"
1919
topics = "embedded", "python"
@@ -27,7 +27,7 @@ class EmbeddedPythonCore(ConanFile):
2727
default_options = {
2828
"zip_stdlib": "stored",
2929
}
30-
exports_sources = "embedded_python_tools.py", "embedded_python*.cmake"
30+
exports_sources = "embedded_python*.cmake"
3131
package_type = "shared-library"
3232

3333
def validate(self):
@@ -279,7 +279,6 @@ def package(self):
279279
src = self.build_folder
280280
dst = pathlib.Path(self.package_folder, "embedded_python")
281281
files.copy(self, "embedded_python*.cmake", src, dst=self.package_folder)
282-
files.copy(self, "embedded_python_tools.py", src, dst=self.package_folder)
283282
license_folder = pathlib.Path(self.package_folder, "licenses")
284283

285284
if self.settings.os == "Windows":
@@ -321,11 +320,9 @@ def package(self):
321320
self._zip_stdlib(dst)
322321

323322
def package_info(self):
324-
self.env_info.PYTHONPATH.append(self.package_folder)
325323
self.cpp_info.set_property(
326324
"cmake_build_modules", ["embedded_python-core.cmake", "embedded_python-tools.cmake"]
327325
)
328-
self.cpp_info.build_modules = ["embedded_python-core.cmake", "embedded_python-tools.cmake"]
329326
prefix = pathlib.Path(self.package_folder) / "embedded_python"
330327
self.cpp_info.includedirs = [str(prefix / "include")]
331328
if self.settings.os == "Windows":

core/embedded_python_tools.py

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

core/test_package/conanfile.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
import pathlib
33
import subprocess
4-
import conan
54
from conan import ConanFile
65
from conan.tools.cmake import CMake, cmake_layout
76

@@ -33,10 +32,7 @@ def build(self):
3332

3433
@property
3534
def _core_package_path(self):
36-
if conan.__version__.startswith("2"):
37-
return pathlib.Path(self.dependencies["embedded_python-core"].package_folder)
38-
else:
39-
return pathlib.Path(self.deps_cpp_info["embedded_python-core"].rootpath)
35+
return pathlib.Path(self.dependencies["embedded_python-core"].package_folder)
4036

4137
@property
4238
def _py_exe(self):

test_package/conanfile.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
import pathlib
33
import subprocess
4-
import conan
54
from conan import ConanFile
65
from conan.tools.cmake import CMake, cmake_layout
76

@@ -27,17 +26,11 @@ class TestEmbeddedPython(ConanFile):
2726

2827
@property
2928
def _core_package_path(self):
30-
if conan.__version__.startswith("2"):
31-
return pathlib.Path(self.dependencies["embedded_python-core"].package_folder)
32-
else:
33-
return pathlib.Path(self.deps_cpp_info["embedded_python-core"].rootpath)
29+
return pathlib.Path(self.dependencies["embedded_python-core"].package_folder)
3430

3531
@property
3632
def _package_path(self):
37-
if conan.__version__.startswith("2"):
38-
return pathlib.Path(self.dependencies["embedded_python"].package_folder)
39-
else:
40-
return pathlib.Path(self.deps_cpp_info["embedded_python"].rootpath)
33+
return pathlib.Path(self.dependencies["embedded_python"].package_folder)
4134

4235
@property
4336
def _py_exe(self):

0 commit comments

Comments
 (0)