2025-05-21 12:56:01 +05:00
|
|
|
SHELL := sh
|
2024-07-23 17:00:22 +10:00
|
|
|
IS_STABLE:=FALSE
|
2024-06-11 13:11:14 +10:00
|
|
|
VERSION:=$(shell cat ../../VERSION)
|
2024-07-23 17:00:22 +10:00
|
|
|
VERSION_DATE:=$(shell date '+%y%m%d')
|
2024-06-11 13:11:14 +10:00
|
|
|
PYVERSION:=py311
|
2024-06-11 14:42:22 +10:00
|
|
|
PLATFORM:=linux64
|
2022-08-31 15:40:47 +10:00
|
|
|
|
2024-07-18 22:44:25 +10:00
|
|
|
PYTHON:=python3.11
|
2024-07-18 23:43:12 +10:00
|
|
|
PIP:=pip3.11
|
2023-02-17 12:03:25 +11:00
|
|
|
SED:=sed -i
|
2024-07-19 18:42:56 +05:00
|
|
|
VENV_ACTIVATE:=bin/activate
|
|
|
|
|
|
2023-02-17 12:03:25 +11:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
|
HOSTOS:=win
|
2024-07-19 18:42:56 +05:00
|
|
|
PYTHON:=python
|
|
|
|
|
VENV_ACTIVATE:=Scripts/activate
|
2023-02-17 12:03:25 +11:00
|
|
|
else
|
|
|
|
|
UNAME_S:=$(shell uname -s)
|
|
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
|
HOSTOS:=linux
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
|
HOSTOS:=macos
|
|
|
|
|
PYTHON:=python3
|
|
|
|
|
PATCH:=patch -d
|
|
|
|
|
SED:=sed -i '' -e
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2025-07-22 16:26:01 +05:00
|
|
|
# TODO: we should simplify this at some point...
|
2022-08-31 15:40:47 +10:00
|
|
|
ifeq ($(PYVERSION), py39)
|
|
|
|
|
PYNUMBER:=39
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(PYVERSION), py310)
|
2023-01-06 16:37:50 +11:00
|
|
|
PYNUMBER:=310
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(PYVERSION), py311)
|
|
|
|
|
PYNUMBER:=311
|
2022-08-31 15:40:47 +10:00
|
|
|
endif
|
2024-04-05 16:54:02 +11:00
|
|
|
ifeq ($(PYVERSION), py312)
|
|
|
|
|
PYNUMBER:=312
|
|
|
|
|
endif
|
2025-07-22 16:26:01 +05:00
|
|
|
ifeq ($(PYVERSION), py313)
|
|
|
|
|
PYNUMBER:=313
|
|
|
|
|
endif
|
|
|
|
|
ifndef PYNUMBER
|
|
|
|
|
$(error Unsupported PYVERSION '$(PYVERSION)')
|
|
|
|
|
endif
|
2022-08-31 15:40:47 +10:00
|
|
|
|
2024-10-30 15:01:04 +05:00
|
|
|
# We actually do support glibc 2.28-2.30 (see #5636)
|
|
|
|
|
# but those are old and there's no demand for it.
|
2024-06-11 14:42:22 +10:00
|
|
|
ifeq ($(PLATFORM), linux64)
|
2023-09-07 09:57:46 +10:00
|
|
|
PLATFORMTAG:=manylinux_2_31_x86_64
|
2022-08-31 15:40:47 +10:00
|
|
|
endif
|
2024-06-11 14:42:22 +10:00
|
|
|
ifeq ($(PLATFORM), macos64)
|
2022-08-31 15:40:47 +10:00
|
|
|
PLATFORMTAG:=macosx_10_15_x86_64
|
|
|
|
|
endif
|
2024-06-11 14:42:22 +10:00
|
|
|
ifeq ($(PLATFORM), macosm164)
|
2022-09-16 22:21:58 +10:00
|
|
|
PLATFORMTAG:=macosx_11_0_arm64
|
|
|
|
|
endif
|
2024-06-11 14:42:22 +10:00
|
|
|
ifeq ($(PLATFORM), win64)
|
2022-08-31 15:40:47 +10:00
|
|
|
PLATFORMTAG:=win_amd64
|
|
|
|
|
endif
|
|
|
|
|
|
2025-08-08 16:33:56 +05:00
|
|
|
BINARY_VERSION:=0.8.4
|
2025-09-12 20:09:28 +05:00
|
|
|
IOS_URL:=https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v$(BINARY_VERSION)-e795cec-$(PLATFORM).zip
|
|
|
|
|
IFCCONVERT_URL:=https://s3.amazonaws.com/ifcopenshell-builds/IfcConvert-v$(BINARY_VERSION)-e795cec-$(PLATFORM).zip
|
2024-06-11 14:42:22 +10:00
|
|
|
|
2025-06-05 18:49:33 +05:00
|
|
|
.PHONY: build-urls
|
|
|
|
|
build-urls:
|
2025-08-12 19:11:28 +05:00
|
|
|
@echo "You can provide one of the 4 platforms (linux64, macos64, macosm164, win64) using 'PLATFORM=xxx'."
|
2025-06-05 18:49:33 +05:00
|
|
|
@echo ${IOS_URL}
|
|
|
|
|
@echo ${IFCCONVERT_URL}
|
|
|
|
|
|
2021-08-31 13:57:38 +10:00
|
|
|
.PHONY: test
|
|
|
|
|
test:
|
2025-05-30 13:12:18 +05:00
|
|
|
pytest -p no:pytest-blender test --ignore=test/util/test_shape_builder.py
|
|
|
|
|
|
|
|
|
|
.PHONY: test-mathutils
|
|
|
|
|
test-mathutils:
|
|
|
|
|
pytest -p no:pytest-blender test/util/test_shape_builder.py
|
2021-08-31 13:57:38 +10:00
|
|
|
|
2022-05-31 19:13:21 +10:00
|
|
|
.PHONY: build-ids-docs
|
|
|
|
|
build-ids-docs:
|
|
|
|
|
mkdir -p test/build
|
|
|
|
|
cd test && python ids_doc_generator.py
|
|
|
|
|
|
2021-09-09 21:27:23 +10:00
|
|
|
.PHONY: qa
|
|
|
|
|
qa:
|
|
|
|
|
black .
|
2021-09-10 10:01:06 +10:00
|
|
|
pylint ./* --output-format=colorized --disable all --enable E
|
2021-09-09 21:27:23 +10:00
|
|
|
|
2022-01-19 12:18:33 +11:00
|
|
|
.PHONY: license
|
|
|
|
|
license:
|
2022-01-20 18:21:57 +11:00
|
|
|
#copyright-header --license LGPL3 --copyright-holder "Thomas Krijnen <thomas@aecgeeks.com>" --copyright-year "2022" --copyright-software "IfcOpenShell" --copyright-software-description "IFC toolkit and geometry engine" -a ./ -o ./
|
|
|
|
|
copyright-header --license LGPL3 --copyright-holder "Dion Moult <dion@thinkmoult.com>" --copyright-year "2022" --copyright-software "IfcOpenShell" --copyright-software-description "IFC toolkit and geometry engine" -a ./ -o ./
|
2022-01-19 12:18:33 +11:00
|
|
|
|
2021-08-31 13:57:38 +10:00
|
|
|
.PHONY: coverage
|
|
|
|
|
coverage:
|
2021-09-20 10:17:16 +10:00
|
|
|
coverage run --source ifcopenshell -m pytest -p no:pytest-blender test
|
2021-08-31 13:57:38 +10:00
|
|
|
coverage html
|
|
|
|
|
xdg-open htmlcov/index.html
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf htmlcov
|
2022-08-31 15:40:47 +10:00
|
|
|
|
2024-07-26 20:04:04 +10:00
|
|
|
.PHONY: zip-ifcconvert
|
|
|
|
|
zip-ifcconvert:
|
|
|
|
|
ifndef PLATFORM
|
|
|
|
|
$(error PLATFORM is not set)
|
|
|
|
|
endif
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
cd dist && wget $(IFCCONVERT_URL)
|
|
|
|
|
cd dist && mv *.zip ifcconvert-$(VERSION)-$(PLATFORM).zip
|
|
|
|
|
|
2024-06-11 14:42:22 +10:00
|
|
|
.PHONY: zip
|
|
|
|
|
zip:
|
|
|
|
|
ifndef PLATFORM
|
|
|
|
|
$(error PLATFORM is not set)
|
|
|
|
|
endif
|
|
|
|
|
rm -rf dist
|
|
|
|
|
mkdir -p dist/working
|
|
|
|
|
mkdir -p dist/ifcopenshell
|
|
|
|
|
cp -r ifcopenshell/* dist/ifcopenshell/
|
|
|
|
|
|
|
|
|
|
cd dist/working && wget $(IOS_URL)
|
|
|
|
|
cd dist/working && unzip ifcopenshell-python*
|
2024-07-14 23:27:22 +10:00
|
|
|
cp -r dist/working/ifcopenshell/*ifcopenshell_wrapper* dist/ifcopenshell/
|
2024-06-11 14:42:22 +10:00
|
|
|
rm -rf dist/working
|
|
|
|
|
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' dist/ifcopenshell/__init__.py
|
|
|
|
|
cd dist && zip -r ifcopenshell-python-$(VERSION)-$(PYVERSION)-$(PLATFORM).zip ifcopenshell
|
|
|
|
|
rm -rf dist/ifcopenshell
|
|
|
|
|
|
2022-08-31 15:40:47 +10:00
|
|
|
.PHONY: dist
|
|
|
|
|
dist:
|
|
|
|
|
ifndef PLATFORM
|
|
|
|
|
$(error PLATFORM is not set)
|
|
|
|
|
endif
|
2024-07-18 23:43:12 +10:00
|
|
|
rm -rf build
|
|
|
|
|
mkdir -p build
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
cp -r ifcopenshell build/
|
|
|
|
|
|
|
|
|
|
mkdir build/botbuild
|
|
|
|
|
cd build/botbuild && wget $(IOS_URL) && unzip ifcopenshell-python*
|
|
|
|
|
cp -r build/botbuild/ifcopenshell/*ifcopenshell_wrapper* build/ifcopenshell/
|
|
|
|
|
cp ../../README.md build/
|
|
|
|
|
cp pyproject.toml build/
|
2024-07-23 17:00:22 +10:00
|
|
|
ifeq ($(IS_STABLE), TRUE)
|
2025-02-12 08:03:36 +11:00
|
|
|
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/pyproject.toml
|
|
|
|
|
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/ifcopenshell/__init__.py
|
2024-07-23 17:00:22 +10:00
|
|
|
else
|
|
|
|
|
$(SED) 's/version = "0.0.0"/version = "$(VERSION)a$(VERSION_DATE)"/' build/pyproject.toml
|
|
|
|
|
$(SED) 's/version = "0.0.0"/version = "$(VERSION)-alpha$(VERSION_DATE)"/' build/ifcopenshell/__init__.py
|
|
|
|
|
endif
|
2024-07-18 23:43:12 +10:00
|
|
|
|
2024-07-19 18:42:56 +05:00
|
|
|
cd build && $(PYTHON) -m venv env && . env/$(VENV_ACTIVATE) && $(PIP) install build
|
|
|
|
|
cd build && . env/$(VENV_ACTIVATE) && $(PYTHON) -m build
|
2024-07-18 23:43:12 +10:00
|
|
|
|
2024-07-23 17:00:22 +10:00
|
|
|
ifeq ($(IS_STABLE), TRUE)
|
2025-02-12 08:03:36 +11:00
|
|
|
mv build/dist/ifcopenshell-*.whl dist/ifcopenshell-$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl
|
2024-07-23 17:00:22 +10:00
|
|
|
else
|
|
|
|
|
cp build/dist/ifcopenshell-*.whl dist/ifcopenshell-$(VERSION)a$(VERSION_DATE)-$(PYVERSION)-none-$(PLATFORMTAG).whl
|
|
|
|
|
endif
|
2024-07-26 20:04:04 +10:00
|
|
|
rm -rf build
|