Repository navigation
Expand file tree
/
Copy pathconda-build.yml
More file actions
73 lines (64 loc) · 2.87 KB
/
Copy pathconda-build.yml
File metadata and controls
73 lines (64 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
parameters:
name: 'Conda build job'
vmImage: 'ubuntu-24.04'
py_maj: '3'
py_min: '14'
# must match src/golden/OCCT_VERSION, otherwise the golden test fails
occt_version: '8.0.1'
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 60
pool:
vmImage: ${{ parameters.vmImage }}
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Add conda to PATH'
# conda-forge only: the defaults channel requires accepting Anaconda's
# terms of service, which fails in an unattended CI run
- bash: |
set -ex
conda create --yes --quiet --name pythonoccgen -c conda-forge --override-channels \
python=${{ parameters.py_maj }}.${{ parameters.py_min }} pip
conda run -n pythonoccgen python -m pip install -r requirements.txt pytest
conda list -n pythonoccgen
displayName: 'Install dependencies from conda-forge'
# the generator only reads the OCCT headers: install the occt package alone,
# without its dependencies, in a separate prefix
- bash: |
set -ex
OCCT_PREFIX=$(Agent.TempDirectory)/occt
conda create --yes --quiet --no-deps -p $OCCT_PREFIX -c conda-forge --override-channels \
"occt=${{ parameters.occt_version }}=novtk*"
CONFIG=$(Agent.TempDirectory)/wrapper_generator.conf
printf '[OCCT]\ninclude_dir: %s\n[pythonocc-core]\nversion: %s\npath: %s\n' \
$OCCT_PREFIX/include/opencascade ${{ parameters.occt_version }} \
$(Build.SourcesDirectory)/pythonocc-core > $CONFIG
cat $CONFIG
# read by generate_wrapper.py in the next steps
echo "##vso[task.setvariable variable=PYTHONOCC_GENERATOR_CONFIG]$CONFIG"
displayName: 'Install OCCT ${{ parameters.occt_version }} headers'
- bash: |
set -ex
cd src
GOLDEN_REQUIRED=1 conda run -n pythonoccgen --no-capture-output python -m pytest -rs
displayName: 'Run unit and golden tests'
- bash: |
set -ex
cd src
conda run -n pythonoccgen --no-capture-output python generate_wrapper.py
displayName: 'Run pythonocc-generator on all modules'
- bash: |
set -ex
conda run -n pythonoccgen python -m pip install mypy
conda run -n pythonoccgen --no-capture-output bash src/mypy_check/check_stubs.sh \
$(Build.SourcesDirectory)/pythonocc-core/src/SWIG_files/wrapper
displayName: 'Type check the generated .pyi stubs with mypy'
# export_occt_structure_to_json.py expects the src/TK*/PACKAGES layout of
# OCCT 7.x sources, OCCT 8 moved toolkits under src/<Module>/
- bash: |
set -ex
wget -q https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_9_0.tar.gz
tar -zxf V7_9_0.tar.gz
cd src
conda run -n pythonoccgen --no-capture-output python export_occt_structure_to_json.py --output occt_toolkits.json ../OCCT-7_9_0
displayName: 'Run occt structure exporter'