Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
source venv/bin/activate
# use version of ifcopenshell with desired schema parsing
# TODO: revert to pyPI when schema parsing is published in the future
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip"
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip"
mkdir -p venv/lib/python3.11/site-packages
unzip -d venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
source venv/bin/activate
# use version of ifcopenshell with desired schema parsing
# TODO: revert to pyPI when schema parsing is published in the future
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip"
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip"
mkdir -p venv/lib/python3.11/site-packages
unzip -d venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:

- name: Download and install ifcopenshell
run: |
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip"
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip"
mkdir -p .dev/venv/lib/python3.11/site-packages
unzip -o -d .dev/venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip
rm /tmp/ifcopenshell_python.zip
Expand Down
12 changes: 6 additions & 6 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ venv:
install: venv
$(PIP) install --upgrade pip
find . -name 'requirements.txt' -exec $(PIP) install -r {} \;
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip"
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip"
mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages
unzip -f -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip
unzip -o -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip
rm /tmp/ifcopenshell_python.zip

install-macos: venv
find . -name 'requirements.txt' -exec $(PIP) install -r {} \;
$(PIP) install -r requirements.txt
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-1c5b825-macos64.zip"
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-macos64.zip"
mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages
unzip /tmp/ifcopenshell_python.zip -d $(VIRTUAL_ENV)/lib/python3.11/site-packages
unzip -o -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip
rm /tmp/ifcopenshell_python.zip

install-macos-m1: venv
find . -name 'requirements.txt' -exec $(PIP) install -r {} \;
$(PIP) install -r requirements.txt
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-7bdc1b6-macosm164.zip"
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-macosm164.zip"
mkdir -p $(VIRTUAL_ENV)/lib/python3.11/site-packages
unzip /tmp/ifcopenshell_python.zip -d $(VIRTUAL_ENV)/lib/python3.11/site-packages
unzip -o -d $(VIRTUAL_ENV)/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip
rm /tmp/ifcopenshell_python.zip

fetch-modules:
Expand Down
10 changes: 10 additions & 0 deletions backend/apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('','2022-05-04T08:08:30',(''),(''),'IfcOpenShell-0.7.0','IfcOpenShell-0.7.0','');
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPERSON($, $,'',$,$,$,$,$);
ENDSEC;
END-ISO-10303-21;
24 changes: 24 additions & 0 deletions backend/apps/ifc_validation/tests/tests_syntax_validation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,30 @@ def test_syntax_validation_task_creates_error_validation_outcome(self):
self.assertEqual(outcomes.first().severity, ValidationOutcome.OutcomeSeverity.ERROR)
self.assertEqual(outcomes.first().outcome_code, ValidationOutcome.ValidationOutcomeCode.SYNTAX_ERROR)
self.assertTrue('On line 1 column 1' in outcomes.first().observed)


def test_syntax_validation_task_creates_error_for_utf8_bom(self):
SyntaxValidationTaskTestCase.set_user_context()
request = ValidationRequest.objects.create(
file_name='invalid_utf8_with_bom.ifc',
file='invalid_utf8_with_bom.ifc',
size=os.path.getsize('apps/ifc_validation/fixtures/invalid_utf8_with_bom.ifc'),
)
request.mark_as_initiated()

syntax_validation_subtask(
prev_result={'is_valid': True, 'reason': 'test'},
id=request.id,
file_name=request.file_name,
)

outcomes = ValidationOutcome.objects.filter(validation_task__request_id=request.id)
self.assertEqual(len(outcomes), 1)
self.assertEqual(outcomes.first().severity, ValidationOutcome.OutcomeSeverity.ERROR)
self.assertEqual(outcomes.first().outcome_code, ValidationOutcome.ValidationOutcomeCode.SYNTAX_ERROR)
self.assertIn("On line 1 column 1", outcomes.first().observed)
self.assertIn("character", outcomes.first().observed.lower())


def test_determine_aggregate_status_for_multiple_outcomes(self):

Expand Down
2 changes: 1 addition & 1 deletion docker/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN --mount=type=cache,target=/root/.cache \
find /app/backend -name 'requirements.txt' -exec pip install --no-cache-dir -r {} \; && \
# use version of ifcopenshell with desired schema parsing
# TODO: revert to pyPI when schema parsing is published in the future
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.5-a51b2c5-linux64.zip" && \
wget -O /tmp/ifcopenshell_python.zip "https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-311-v0.8.6-8b5b400-linux64.zip" && \
mkdir -p /opt/venv/lib/python3.11/site-packages && \
unzip -d /opt/venv/lib/python3.11/site-packages /tmp/ifcopenshell_python.zip && \
# some cleanup
Expand Down
Loading