Skip to content

Commit c32c88b

Browse files
committed
Merge remote-tracking branch 'origin/v0.7.0' into v0.8.0
2 parents 05a7aac + 6e8049c commit c32c88b

File tree

977 files changed

+317284
-64625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

977 files changed

+317284
-64625
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
sudo apt-get install --no-install-recommends \
3030
git cmake gcc g++ libboost-all-dev python3-all-dev swig libpcre3-dev libxml2-dev \
3131
libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \
32-
libhdf5-dev libcgal-dev
32+
libhdf5-dev libcgal-dev nlohmann-json3-dev
3333
3434
-
3535
name: ccache
@@ -61,6 +61,8 @@ jobs:
6161
-DGMP_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
6262
-DMPFR_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
6363
-DHDF5_INCLUDE_DIR=/usr/include/hdf5/serial \
64+
-DGLTF_SUPPORT=On \
65+
-DJSON_INCLUDE_DIR=/usr/include \
6466
../cmake
6567
make -j $(nproc)
6668
make install
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import pathlib
2+
import shutil
3+
4+
import requests
5+
import zipfile
6+
import os
7+
8+
# To test this locally, set these environment variables
9+
REPO_OWNER = os.environ.get("REPO_OWNER", "IfcOpenShell/IfcOpenShell")
10+
MY_WORKFLOW = os.environ.get("MY_WORKFLOW", "ci-ifcopenshell-conda-daily")
11+
WORKFLOW_RUN_ID = os.environ.get("WORKFLOW_RUN_ID", None)
12+
TOKEN = os.environ.get("GITHUB_TOKEN", None)
13+
# To test this locally create a fine-grained personal access token for this repo with permissions "actions:read"
14+
# See https://github.com/settings/tokens?type=beta
15+
16+
# This is a list of strings that indicate that a job has stopped abruptly.
17+
SIGNS_OF_STOPPAGE = [
18+
"Error: The operation was canceled.",
19+
"fatal error C1060: compiler is out of heap space",
20+
]
21+
22+
23+
def start_request_session():
24+
s = requests.Session()
25+
headers = {
26+
"Accept": "application/vnd.github+json",
27+
"X-GitHub-Api-Version": "2022-11-28",
28+
}
29+
if TOKEN:
30+
headers["Authorization"] = f"Bearer {TOKEN}"
31+
32+
s.headers = headers
33+
return s
34+
35+
36+
def get_ci_run(repo_name, run_id):
37+
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{run_id}"
38+
s = start_request_session()
39+
response = s.get(url)
40+
return response.json()
41+
42+
43+
def evaluate_log_file_for_abrupt_stop(log_file):
44+
with open(log_file) as f:
45+
for i, line in enumerate(f):
46+
for sign in SIGNS_OF_STOPPAGE:
47+
if sign in line:
48+
print(f"Found sign of abrupt stoppage in [line {i}]: '{sign}'")
49+
return True
50+
return False
51+
52+
53+
def get_ci_specific_run_specific_failure_details(repo_name, run_id):
54+
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{run_id}/attempts/1/logs"
55+
s = start_request_session()
56+
response = s.get(url)
57+
58+
# SAVE zip file
59+
with open("logs.zip", "wb") as f:
60+
f.write(response.content)
61+
62+
# unzip file
63+
with zipfile.ZipFile("logs.zip", "r") as zip_ref:
64+
zip_ref.extractall("logs")
65+
66+
failed_logs = []
67+
for file in pathlib.Path("logs").iterdir():
68+
if file.is_dir():
69+
continue
70+
71+
if evaluate_log_file_for_abrupt_stop(file):
72+
failed_logs.append(file)
73+
74+
return failed_logs
75+
76+
77+
def restart_job(repo_name, job_id):
78+
url = f"https://api.github.com/repos/{repo_name}/actions/runs/{job_id}/rerun-failed-jobs"
79+
s = start_request_session()
80+
response = s.post(url)
81+
return response.json()
82+
83+
84+
def eval_jobs():
85+
run = get_ci_run(REPO_OWNER, WORKFLOW_RUN_ID)
86+
if run["run_attempt"] > 1:
87+
print("This is not the first attempt. Exiting")
88+
return
89+
failed_logs = get_ci_specific_run_specific_failure_details(REPO_OWNER, WORKFLOW_RUN_ID)
90+
91+
if len(failed_logs) == 0:
92+
print("No runs exhibit signs of abrupt stoppage")
93+
return
94+
95+
print("restarting job", WORKFLOW_RUN_ID)
96+
r = restart_job(REPO_OWNER, WORKFLOW_RUN_ID)
97+
print(r)
98+
99+
shutil.rmtree("logs")
100+
os.remove("logs.zip")
101+
102+
103+
if __name__ == "__main__":
104+
eval_jobs()

.github/workflows/ci-blenderbim-choco.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions/checkout@v2
4444
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
4545
with:
46-
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
46+
python-version: '3.10.9' # Version range or exact version of a Python version to use, using SemVer's version range syntax
4747
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
4848
- run: echo ${{ env.DATE }}
4949

.github/workflows/ci-blenderbim-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
- uses: actions/checkout@v2
6262
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
6363
with:
64-
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
6564
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
65+
python-version: '3.10'
6666
- run: echo ${{ env.DATE }}
6767
- name: Get current date
6868
id: date

.github/workflows/ci-ifcopenshell-conda-daily.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
name: ci-ifcopenshell-conda-daily
22

33
on:
4-
workflow_run:
5-
workflows: ["ci"]
6-
types:
7-
- completed
4+
push:
5+
paths:
6+
- .github/workflows/ci-ifcopenshell-conda-daily.yml
7+
schedule:
8+
# ┌───────────── minute (0 - 59)
9+
# │ ┌───────────── hour (0 - 23)
10+
# │ │ ┌───────────── day of the month (1 - 31)
11+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
12+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
13+
# * * * * *
14+
- cron: "49 23 * * *" # 11min before utc midnight every day
815

916
jobs:
1017
activate:
@@ -26,20 +33,16 @@ jobs:
2633
fail-fast: false
2734
matrix:
2835
pyver: [
29-
# { name: py39, distver: '3.9' },
3036
{ name: py310, distver: '3.10'},
3137
{ name: py311, distver: '3.11'}
3238
]
3339
platform: [
34-
{ name: Windows, distver: windows-2022, upload: 'false' },
35-
{ name: Windows, distver: windows-2019, upload: 'true' },
36-
{ name: Linux, distver: ubuntu-20.04, upload: 'true' },
37-
{ name: Linux, distver: ubuntu-22.04, upload: 'false' },
38-
{ name: macOS, distver: macos-11, upload: 'true' },
39-
{ name: macOS, distver: macos-12, upload: 'false' }
40+
{ name: Windows, distver: windows-2022, upload: 'true' },
41+
{ name: Linux, distver: ubuntu-22.04, upload: 'true' },
42+
{ name: macOS, distver: macos-12, upload: 'true' }
4043
]
4144
steps:
42-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
4346
with:
4447
submodules: recursive
4548
- name: Download MacOSX SDK
@@ -58,8 +61,10 @@ jobs:
5861
- name: build, test and upload ifcopenshell
5962
if: ${{ matrix.platform.upload == 'true' }}
6063
run: |
61-
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell --no-remove-work-dir
64+
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --token ${{ secrets.ANACONDA_TOKEN }} --user ifcopenshell
65+
working-directory: ./conda
6266
- name: build & test ifcopenshell
6367
if: ${{ matrix.platform.upload == 'false' }}
6468
run: |
65-
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge --no-remove-work-dir
69+
conda-build . --python ${{ matrix.pyver.distver }} -c conda-forge
70+
working-directory: ./conda

.github/workflows/ci-ifcopenshell-pypi.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ on:
88
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
99
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
1010
# * * * * *
11-
- cron: "49 23 1 * *" # 11min before utc midnight
11+
- cron: "0 0 18 * *"
12+
push:
13+
paths:
14+
- '.github/workflows/ci-ifcopenshell-pypi.yml'
15+
1216

1317
env:
1418
major: 0
@@ -31,7 +35,7 @@ jobs:
3135
strategy:
3236
fail-fast: false
3337
matrix:
34-
pyver: [py36, py37, py38, py39, py310]
38+
pyver: [py36, py37, py38, py39, py310, py311]
3539
config:
3640
- {
3741
name: "Windows Build",
@@ -53,7 +57,7 @@ jobs:
5357
- uses: actions/checkout@v2
5458
- uses: actions/setup-python@v2 # https://github.com/actions/setup-python
5559
with:
56-
python-version: '3.7.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
60+
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
5761
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
5862
- run: echo ${{ env.DATE }}
5963
- name: Get current date

.github/workflows/ci-py-only.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'test/**'
88
- 'conda/**'
99
- 'cmake/**'
10-
- '.github/workflows/ci_py_only.yml'
10+
- '.github/workflows/ci-py-only.yml'
1111
pull_request:
1212

1313
jobs:
@@ -46,13 +46,14 @@ jobs:
4646
4747
- name: ccache
4848
uses: hendrikmuhs/ccache-action@v1
49+
with:
50+
key: ${GITHUB_WORKFLOW}
4951

5052
- name: Build ifcopenshell
5153
run: |
54+
sudo /usr/sbin/update-ccache-symlinks
5255
mkdir build && cd build
53-
cmake \
54-
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
55-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
56+
PATH="/usr/lib/ccache:$PATH" cmake \
5657
-DCMAKE_BUILD_TYPE=Release \
5758
-DCMAKE_PREFIX_PATH=/usr \
5859
-DCMAKE_SYSTEM_PREFIX_PATH=/usr \
@@ -62,7 +63,7 @@ jobs:
6263
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
6364
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
6465
-DCOLLADA_SUPPORT=Off \
65-
"-DSCHEMA_VERSIONS=2x3;4" \
66+
"-DSCHEMA_VERSIONS=2x3;4;4x3_add1" \
6667
-DBUILD_CONVERT=Off \
6768
-DGLTF_SUPPORT=On \
6869
-DJSON_INCLUDE_DIR=/usr/include \
@@ -80,12 +81,14 @@ jobs:
8081
- name: Install Python dependencies
8182
run: |
8283
sudo /usr/bin/python -m pip install -U pip
83-
sudo /usr/bin/python -m pip install xmlschema numpy lxml
84-
sudo /usr/bin/python -m pip install src/bcf
84+
sudo /usr/bin/python -m pip install xmlschema xsdata numpy lxml
85+
sudo /usr/bin/python -m pip install src/bcf --no-deps
8586
sudo /usr/bin/python -m pip install pytest
8687
sudo /usr/bin/python -m pip install isodate
8788
sudo /usr/bin/python -m pip install lark
8889
sudo /usr/bin/python -m pip install networkx
90+
sudo /usr/bin/python -m pip install tabulate
91+
sudo /usr/bin/python -m pip install dateutil
8992
9093
- name: Test
9194
run: |
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Restart failed daily conda builds
2+
3+
on:
4+
workflow_run:
5+
workflows: [ ci-ifcopenshell-conda-daily ]
6+
types:
7+
- completed
8+
9+
env:
10+
REPO_OWNER: IfcOpenShell/IfcOpenShell
11+
MY_WORKFLOW: ci-ifcopenshell-conda-daily
12+
13+
jobs:
14+
restart-failed-runs:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
17+
steps:
18+
- name: checkout
19+
uses: actions/checkout@v3
20+
- name: Use python 3.11
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.11
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install requests
28+
- name: Check for failed runs
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
32+
run: |
33+
python check_repo_ci_jobs.py
34+
working-directory: .github/workflows

.github/workflows/ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
5858
- name: ccache
5959
uses: hendrikmuhs/ccache-action@v1
60+
with:
61+
key: ${GITHUB_WORKFLOW}
6062

6163
- name: Build ifcopenshell
6264
run: |
@@ -73,7 +75,7 @@ jobs:
7375
-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 \
7476
-DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so \
7577
-DCOLLADA_SUPPORT=Off \
76-
"-DSCHEMA_VERSIONS=2x3;4;4x3" \
78+
"-DSCHEMA_VERSIONS=2x3;4;4x3_add1" \
7779
-DGLTF_SUPPORT=On \
7880
-DJSON_INCLUDE_DIR=/usr/include \
7981
-DCGAL_INCLUDE_DIR=/usr/include \
@@ -87,15 +89,32 @@ jobs:
8789
sudo make -j $(nproc)
8890
sudo make install
8991
92+
- name: Run IfcConvert on Sample files
93+
run: |
94+
(find test/input src/blenderbim/test/files -name '*.ifc' | while read i; do \
95+
echo $i | tee -a log; \
96+
timeout 1m "$(which IfcConvert)" -yv "$i" "$i.obj" --validate >> log 2>&1; \
97+
echo $i $? >> statuses; \
98+
done) || true
99+
echo Failed
100+
grep -v 0$ statuses
101+
grep -v 0$ statuses | wc -l
102+
echo Succeeded
103+
grep 0$ statuses
104+
grep 0$ statuses | wc -l
105+
90106
- name: Install Python dependencies
91107
run: |
92108
sudo /usr/bin/python -m pip install -U pip
93-
sudo /usr/bin/python -m pip install xmlschema numpy lxml
94-
sudo /usr/bin/python -m pip install src/bcf
109+
sudo /usr/bin/python -m pip install xmlschema xsdata numpy lxml
110+
sudo /usr/bin/python -m pip install src/bcf --no-deps
95111
sudo /usr/bin/python -m pip install pytest
96112
sudo /usr/bin/python -m pip install isodate
97113
sudo /usr/bin/python -m pip install lark
98114
sudo /usr/bin/python -m pip install networkx
115+
sudo /usr/bin/python -m pip install https://github.com/Andrej730/aud/archive/refs/heads/master-reduced-size.zip
116+
sudo /usr/bin/python -m pip install tabulate
117+
sudo /usr/bin/python -m pip install dateutil
99118
100119
- name: Test
101120
run: |

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,16 @@ src/ifcopenshell-python/test/build
7777
# tox cache
7878
.tox/
7979
*.egg-info/
80+
81+
# mypy cache
82+
.mypy_cache
83+
84+
# blenderbim libs
85+
src/blenderbim/blenderbim/libs
86+
87+
# blenderbim test temp files
88+
src/blenderbim/test/files/temp
89+
90+
# ifcopenshell swig and compiled files
91+
src/ifcopenshell-python/ifcopenshell/_ifcopenshell_wrapper.so
92+
src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.py

0 commit comments

Comments
 (0)