Skip to content

Commit 5a9fd05

Browse files
committed
conan remote
1 parent 408daed commit 5a9fd05

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

.github/workflows/pip.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
python-version: ${{ matrix.python-version }}
2222
- name: Add requirements
2323
run: python -m pip install --upgrade pip wheel setuptools conan
24+
- name: Conan detect profile
25+
run: conan profile detect
2426
- name: Build and install
2527
run: pip install --verbose .[test]
2628
- name: Test

.github/workflows/wheels.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
python-version: "3.x"
3939
- name: Add requirements
4040
run: python -m pip install --upgrade pip conan
41+
- name: Conan detect profile
42+
run: conan profile detect
4143
- uses: pypa/cibuildwheel@v2.17
4244
env:
4345
CIBW_ARCHS_MACOS: auto universal2

setup.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,27 @@ def build_extension(self, ext: CMakeExtension) -> None:
2121
build_temp = Path(self.build_temp) / ext.name
2222
build_temp.mkdir(parents=True, exist_ok=True)
2323

24+
conan_odr_remote = "https://artifactory.opendocument.app/artifactory/api/conan/conan"
25+
26+
result = subprocess.run(["conan", "remote", "list"], check=True, capture_output=True, text=True)
27+
if conan_odr_remote not in result.stdout:
28+
print(f"Adding Conan remote {conan_odr_remote}")
29+
subprocess.run([
30+
"conan",
31+
"remote",
32+
"add",
33+
"odr",
34+
conan_odr_remote,
35+
], check=True)
36+
2437
conan_args = [
2538
f"--output-folder={build_temp}",
2639
"--build=missing",
27-
"-s", "build_type=Release",
40+
"-s",
41+
"build_type=Release",
2842
]
2943

30-
subprocess.run(
31-
["conan", "install", ext.sourcedir, *conan_args], check=True
32-
)
44+
subprocess.run(["conan", "install", ext.sourcedir, *conan_args], check=True)
3345

3446
cmake_args = [
3547
f"-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake",
@@ -43,9 +55,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
4355
subprocess.run(
4456
["cmake", "-S", ext.sourcedir, "-B", build_temp, *cmake_args], check=True
4557
)
46-
subprocess.run(
47-
["cmake", "--build", build_temp, *build_args], check=True
48-
)
58+
subprocess.run(["cmake", "--build", build_temp, *build_args], check=True)
4959

5060

5161
setup(

0 commit comments

Comments
 (0)