Skip to content

Commit

Permalink
feat: use conda environment for cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Nov 22, 2023
1 parent b7cd658 commit 4d2d901
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,29 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.10"

- name: Install libraries
run: |
conda install -c conda-forge boost pyboost
conda install -c conda-forge eigen
conda install -c conda-forge geographiclib-cpp==1.52
conda install -c conda-forge pugixml
conda install -c conda-forge gtest
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.machine.platform }}

Expand Down
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pytest = ["pytest"]

[tool.scikit-build]
build-dir = "build/{wheel_tag}"
cmake.args = ["--preset conan-release"]
#cmake.args = ["--preset conan-release"]
cmake.define = { LANELET2_ENABLE_TESTING = "OFF" }
cmake.build-type = "Release"
wheel.packages = ["lanelet2_python/src/lanelet2"]
Expand All @@ -45,18 +45,16 @@ wheel.license-files = ["LICENSE", "CODEOWNERS"]
provider = "scikit_build_core.metadata.regex"
input = "lanelet2_python/src/lanelet2/__init__.py"

[[tool.scikit-build.overrides]]
if.platform-system = "win32"
cmake.args = ["--preset conan-default"]
#[[tool.scikit-build.overrides]]
#if.platform-system = "win32"
#cmake.args = ["--preset conan-default"]

[tool.cibuildwheel]
# Skip 32-bit builds
skip = ["*-win32", "*-manylinux_i686"]
before-build = [
"python -m pip install --upgrade pip",
"pip install -r requirements.txt",
"conan profile detect --force",
"conan install . --output-folder=build --build=missing"
]
#before-build = [
# "python -m pip install --upgrade pip",
# "pip install -r requirements.txt",
# "conan profile detect --force",
# "conan install . --output-folder=build --build=missing"
#]
test-requires = "pytest"
test-command = "pytest {project}/lanelet2_python/test"

0 comments on commit 4d2d901

Please sign in to comment.