Skip to content

Commit b2a6d0e

Browse files
committed
Merge branch 'v7.9' of https://github.com/CadQuery/ocp-build-system into v7.9
2 parents 01da5f8 + 42dbf5a commit b2a6d0e

4 files changed

Lines changed: 121 additions & 136 deletions

File tree

.github/actions/build-ocp-addons/action.yml

Lines changed: 71 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ inputs:
77
python-version:
88
description: "Python version to use for the build"
99
required: true
10-
sed-i:
11-
description: "Sed in-place command for the OS"
10+
shells:
11+
description: "Shell configuration for the OS"
1212
required: true
1313
github-token:
1414
required: true
@@ -21,77 +21,49 @@ runs:
2121

2222
# - - -
2323

24-
- name: (Linux) Install ca-certificates
25-
if: runner.os == 'Linux'
26-
shell: bash -l {0}
27-
run: |
28-
# (Linux) Install ca-certificates
29-
set -e
30-
set -u
31-
set -o pipefail
32-
33-
apt-get update -qq
34-
DEBIAN_FRONTEND=noninteractive apt-get install -qq ca-certificates > /dev/null 2>&1
35-
36-
# - - -
37-
38-
- name: Set up Python ${{ inputs.python-version }} via micromamba
39-
uses: mamba-org/setup-micromamba@v2
40-
with:
41-
environment-file: environment-ocpaddons-${{ inputs.python-version }}.yml
42-
log-level: warning
43-
init-shell: bash
44-
cache-downloads: true
45-
cache-environment: true
46-
cache-environment-key: environment-ocpaddons-${{ inputs.python-version }}-${{ inputs.os }}-novtk
47-
48-
# - - -
49-
5024
- name: Install Linux Dependencies (x86_64)
5125
if: runner.os == 'Linux'
52-
shell: bash -l {0}
26+
shell: bash -leo pipefail {0}
5327
run: |
5428
# Install Linux Dependencies (x86_64)
55-
set -e
56-
set -o pipefail
5729
5830
apt-get update -qq
59-
apt-get install -qq -y freetype* libfreetype6-dev libgl1-mesa-glx git \
60-
patch gcc g++ build-essential > /dev/null 2>&1
61-
62-
pip install auditwheel patchelf build wheel
63-
micromamba info
64-
micromamba list
31+
apt-get install -qq -y freetype* libfreetype6-dev libgl1-mesa-glx git \
32+
ca-certificates patch gcc g++ build-essential > /dev/null 2>&1
6533
6634
# - - -
6735

6836
- name: Install MacOS Dependencies (x86_64 / arm64)
6937
if: runner.os == 'macOS'
70-
shell: bash -l {0}
38+
shell: bash -leo pipefail {0}
7139
run: |
7240
# Install MacOS Dependencies (x86_64 / arm64)
73-
set -e
74-
set -o pipefail
75-
76-
brew install automake gsed tree
77-
78-
pip install delocate build wheel
7941
80-
# curl -L -O https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz
81-
# sudo tar -xf MacOSX11.3.sdk.tar.xz -C /opt
42+
brew install gsed
43+
# ensure gnu sed is in PATH before system (BSD) sed
44+
sudo ln -s "$(brew --prefix gnu-sed)/libexec/gnubin/sed" /usr/local/bin/sed
8245
8346
# - - -
84-
85-
- name: Install Windows Dependencies (x86_64)
86-
if: runner.os == 'Windows'
87-
shell: bash -l {0}
47+
48+
- name: Prepare environment.yml
49+
shell: bash -leo pipefail {0}
8850
run: |
89-
# Install Windows Dependencies (x86_64)
90-
set -e
91-
set -o pipefail
92-
93-
micromamba install vs2019_win-64 -c conda-forge
94-
pip install delvewheel build wheel
51+
# Install Linux Dependencies (x86_64)
52+
53+
sed -i 's/__PY_VERSION__/${{ inputs.python-version }}/' environment-ocpaddons.yml
54+
55+
cat environment-ocpaddons.yml
56+
57+
# - - -
58+
59+
- name: Set up Python ${{ inputs.python-version }} via micromamba
60+
uses: mamba-org/setup-micromamba@v2
61+
with:
62+
environment-file: environment-ocpaddons.yml
63+
log-level: warning
64+
init-shell: ${{ inputs.shells }}
65+
cache-environment: true
66+
cache-environment-key: environment-ocpaddons-${{ inputs.python-version }}-${{ inputs.os }}-novtk
9567

9668
# - - -
9769

@@ -105,23 +77,43 @@ runs:
10577
# - - -
10678

10779
- name: Clone ocp-addons and build wheel
108-
shell: bash -l {0}
80+
if: runner.os != 'Windows'
81+
shell: bash -leo pipefail {0}
82+
env:
83+
OCCT_SDK: ${{ github.workspace }}/occt-${{ env.OCCT }}-novtk
10984
run: |
11085
# Clone ocp-addons and build wheel
111-
set -e
112-
set -o pipefail
11386
11487
git clone https://github.com/jdegenstein/ocp-addons.git
115-
11688
cd ocp-addons
11789
git switch ocp-build-system
11890
119-
export OCCT_SDK="$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk"
12091
python -m build -n -w
12192
ls -l dist
12293
12394
# - - -
12495

96+
- name: Clone ocp-addons and build wheel
97+
if: runner.os == 'Windows'
98+
shell: cmd
99+
env:
100+
OCCT_SDK: ${{ github.workspace }}\occt-${{ env.OCCT }}-novtk
101+
run: |
102+
rem Clone ocp-addons and build wheel
103+
104+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
105+
set CC=cl.exe
106+
set CXX=cl.exe
107+
108+
git clone https://github.com/jdegenstein/ocp-addons.git
109+
cd ocp-addons
110+
git switch ocp-build-system
111+
112+
micromamba run -n build-ocp python -m build -n -w
113+
dir dist
114+
115+
# - - -
116+
125117
- name: Upload wheel
126118
uses: actions/upload-artifact@v4
127119
with:
@@ -132,34 +124,32 @@ runs:
132124

133125
- name: Repair Linux Wheel (x86_64)
134126
if: runner.os == 'Linux'
135-
shell: bash -l {0}
127+
shell: bash -leo pipefail {0}
136128
run: |
137129
# Repair Linux Wheel (x86_64)
138-
139-
set -e
140-
set -o pipefail
141130
131+
pip install auditwheel patchelf
132+
142133
cd ocp-addons
143-
VERSION=$(awk -F'"' '/^__version__/ {print $2}' setup.py)
134+
VERSION=$(python setup.py --version)
144135
145-
env LD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib auditwheel repair \
136+
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib auditwheel repair \
146137
--plat manylinux_2_31_x86_64 dist/ocp_addons-${VERSION}*.whl
147138
148139
# - - -
149140

150141
- name: Repair MacOS Wheel (x86_64 / arm64)
151142
if: runner.os == 'macOS'
152-
shell: bash -l {0}
143+
shell: bash -leo pipefail {0}
153144
run: |
154145
# Repair MacOS Wheel (x86_64 / arm64)
155-
156-
set -e
157-
set -o pipefail
158146
147+
pip install delocate
148+
159149
cd ocp-addons
160-
VERSION=$(awk -F'"' '/^__version__/ {print $2}' setup.py)
150+
VERSION=$(python setup.py --version)
161151
162-
# Patch @rpath/libc++.1.dylib to /usr/lib/libc++.1.dylib
152+
# Patch @rpath/libc++.1.dylib to /usr/lib/libc++.1.dylib to ensure delocate works successfully
163153
cd dist
164154
python -m wheel unpack ocp_addons-${VERSION}*.whl
165155
@@ -174,7 +164,6 @@ runs:
174164
python -m wheel pack ocp_addons-${VERSION}
175165
cd ..
176166
177-
# @rpath/libc++.1.dylib confuses delocate but can safely be ignored
178167
DYLD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib:/usr/lib python \
179168
-m delocate.cmd.delocate_wheel \
180169
--ignore-missing-dependencies \
@@ -184,17 +173,18 @@ runs:
184173

185174
- name: Repair Windows Wheel (x86_64)
186175
if: runner.os == 'Windows'
187-
shell: bash -l {0}
176+
shell: bash -leo pipefail {0}
188177
run: |
189178
# Repair Windows Wheel (x86_64)
190-
set -e
191-
set -o pipefail
192-
179+
180+
pip install delvewheel
181+
193182
cd ocp-addons
194-
VERSION=$(awk -F'"' '/^__version__/ {print $2}' setup.py)
183+
VERSION=$(python setup.py --version)
184+
185+
ls -l $GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/win64/vc14/bin
195186
196-
PATH=LD_LIBRARY_PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/lib:$PATH
197-
python -m delvewheel repair --wheel-dir=wheelhouse dist/ocp_addons-${VERSION}*.whl
187+
PATH=$GITHUB_WORKSPACE/occt-${{ env.OCCT }}-novtk/win64/vc14/bin:$PATH python -m delvewheel repair --wheel-dir=wheelhouse dist/ocp_addons-${VERSION}*.whl
198188
199189
# - - -
200190

.github/actions/test-ocp-addons/action.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ inputs:
77
python-version:
88
description: "Python version to use for the build"
99
required: true
10-
sed-i:
11-
description: "Sed in-place command for the OS"
12-
required: true
1310
github-token:
1411
required: true
1512
description: 'GitHub Token'
@@ -23,39 +20,47 @@ runs:
2320

2421
- name: (Linux) Install ca-certificates
2522
if: runner.os == 'Linux'
26-
shell: bash -l {0}
23+
shell: bash -leo pipefail {0}
2724
run: |
2825
# (Linux) Install ca-certificates
29-
set -e
30-
set -u
31-
set -o pipefail
3226
3327
sudo apt-get update -qq
3428
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq ca-certificates > /dev/null 2>&1
29+
30+
# - - -
31+
32+
- name: Install MacOS Dependencies (x86_64 / arm64)
33+
if: runner.os == 'macOS'
34+
shell: bash -leo pipefail {0}
35+
run: |
36+
# Install MacOS Dependencies (x86_64 / arm64)
37+
38+
brew install gsed
39+
# ensure gnu sed is in PATH before system (BSD) sed
40+
sudo ln -s "$(brew --prefix gnu-sed)/libexec/gnubin/sed" /usr/local/bin/sed
41+
42+
# - - -
43+
44+
- name: Prepare environment.yml
45+
shell: bash -leo pipefail {0}
46+
run: |
47+
# Install Linux Dependencies (x86_64)
48+
49+
sed -i 's/__PY_VERSION__/${{ inputs.python-version }}/' environment-ocpaddons.yml
50+
51+
cat environment-ocpaddons.yml
3552
3653
# - - -
3754

3855
- name: Set up Python ${{ inputs.python-version }} via micromamba
3956
uses: mamba-org/setup-micromamba@v2
4057
with:
41-
environment-file: environment-ocpaddons-${{ inputs.python-version }}.yml
58+
environment-file: environment-ocpaddons.yml
4259
log-level: warning
4360
init-shell: bash
4461
cache-downloads: true
4562
cache-environment: true
46-
cache-environment-key: environment-ocpaddons-${{ inputs.python-version }}-${{ inputs.os }}-novtk
47-
48-
# - - -
49-
50-
- name: Install MacOS Dependencies (x86_64 / arm64)
51-
if: runner.os == 'macOS'
52-
shell: bash -l {0}
53-
run: |
54-
# Install MacOS Dependencies (x86_64 / arm64)
55-
set -e
56-
set -o pipefail
57-
58-
brew install gsed
63+
cache-environment-key: environment-ocpaddons-${{ inputs.os }}-novtk
5964

6065
# - - -
6166

@@ -77,11 +82,9 @@ runs:
7782
# - - -
7883

7984
- name: Test Repaired Wheel and Run Package Tests
80-
shell: bash -l {0}
85+
shell: bash -leo pipefail {0}
8186
run: |
8287
# Test Repaired Wheel and Run Package Tests
83-
set -e
84-
set -o pipefail
8588
8689
pip install cadquery_ocp-*.whl
8790
python -c "import OCP; print('Success: OCP', OCP.__version__)"
@@ -91,14 +94,14 @@ runs:
9194
9295
git clone https://github.com/snoyer/ocpsvg.git
9396
cd ocpsvg
94-
${{ inputs.sed-i }} 's/cadquery-ocp >= 7\.8\.1, < 7\.9\.0/cadquery-ocp >= 7.8, < 8.0/g' pyproject.toml
97+
sed -i 's/cadquery-ocp >= 7\.8\.1, < 7\.9\.0/cadquery-ocp >= 7.8, < 8.0/g' pyproject.toml
9598
pip install .
9699
cd ..
97100
98101
git clone https://github.com/gumyr/build123d.git
99102
cd build123d
100103
git checkout 1af4b0c3129dd152a1c9cb01400c1e648a5de8e2 # pre Gordon face to avoid 7.9. issues
101-
${{ inputs.sed-i }} 's/cadquery-ocp >= 7\.8, < 7\.9/cadquery-ocp >= 7.8, < 8.0/g' pyproject.toml
104+
sed -i 's/cadquery-ocp >= 7\.8, < 7\.9/cadquery-ocp >= 7.8, < 8.0/g' pyproject.toml
102105
pip install .
103106
cd ..
104107

0 commit comments

Comments
 (0)