2022-08-31 15:40:47 +10:00
|
|
|
VERSION:=`date '+%y%m%d'`
|
|
|
|
|
PYVERSION:=py310
|
|
|
|
|
PLATFORM:=linux
|
|
|
|
|
|
2023-02-17 12:03:25 +11:00
|
|
|
SED:=sed -i
|
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
|
HOSTOS:=win
|
|
|
|
|
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
|
|
|
|
|
|
2022-08-31 15:40:47 +10:00
|
|
|
ifeq ($(PYVERSION), py36)
|
|
|
|
|
PYNUMBER:=36
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(PYVERSION), py37)
|
|
|
|
|
PYNUMBER:=37
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(PYVERSION), py38)
|
|
|
|
|
PYNUMBER:=38
|
|
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM), linux)
|
|
|
|
|
PLATFORMTAG:=manylinux1_x86_64
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(PLATFORM), macos)
|
|
|
|
|
PLATFORMTAG:=macosx_10_15_x86_64
|
|
|
|
|
endif
|
2022-09-16 22:21:58 +10:00
|
|
|
ifeq ($(PLATFORM), macosm1)
|
|
|
|
|
PLATFORMTAG:=macosx_11_0_arm64
|
|
|
|
|
endif
|
2022-08-31 15:40:47 +10:00
|
|
|
ifeq ($(PLATFORM), win)
|
|
|
|
|
PLATFORMTAG:=win_amd64
|
|
|
|
|
endif
|
|
|
|
|
|
2022-09-16 22:21:58 +10:00
|
|
|
ifeq ($(PLATFORM), macosm1)
|
|
|
|
|
ifeq ($(PYVERSION), py36)
|
|
|
|
|
# Pure Evil. Let me know if you're the first to file a bug report.
|
|
|
|
|
PYNUMBER:=37
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2023-01-06 16:37:50 +11:00
|
|
|
ifeq ($(PLATFORM), macos)
|
|
|
|
|
ifeq ($(PYVERSION), py311)
|
|
|
|
|
# Pure Evil. Let me know if you're the first to file a bug report.
|
|
|
|
|
PYNUMBER:=310
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2021-08-31 13:57:38 +10:00
|
|
|
.PHONY: test
|
|
|
|
|
test:
|
2021-09-03 14:11:15 +10:00
|
|
|
pytest -p no:pytest-blender test
|
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
|
|
|
|
|
|
|
|
.PHONY: dist
|
|
|
|
|
dist:
|
|
|
|
|
ifndef PLATFORM
|
|
|
|
|
$(error PLATFORM is not set)
|
|
|
|
|
endif
|
|
|
|
|
rm -rf dist
|
|
|
|
|
mkdir -p dist/working
|
|
|
|
|
mkdir -p dist/ifcopenshell
|
|
|
|
|
cp -r ifcopenshell/* dist/ifcopenshell/
|
|
|
|
|
|
2023-01-25 16:55:05 +11:00
|
|
|
cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.0-07ee62e-$(PLATFORM)64.zip
|
2022-08-31 15:40:47 +10:00
|
|
|
cd dist/working && unzip ifcopenshell-python*
|
|
|
|
|
cp -r dist/working/ifcopenshell/ifcopenshell_wrapper.py dist/ifcopenshell/
|
|
|
|
|
ifeq ($(PLATFORM), win)
|
|
|
|
|
cp -r dist/working/ifcopenshell/_ifcopenshell_wrapper.pyd dist/ifcopenshell/
|
|
|
|
|
else
|
|
|
|
|
cp -r dist/working/ifcopenshell/_ifcopenshell_wrapper.so dist/ifcopenshell/
|
|
|
|
|
endif
|
|
|
|
|
rm -rf dist/working
|
2023-02-12 20:32:30 +11:00
|
|
|
# distutils cannot access anything outside the cwd, so hackishly swap out the README.md
|
2023-02-15 20:06:07 +11:00
|
|
|
cp README.md ../README.bak
|
2023-02-12 20:32:30 +11:00
|
|
|
cp ../../README.md README.md
|
2023-02-17 12:03:25 +11:00
|
|
|
$(SED) "s/999999/$(VERSION)/" pyproject.toml
|
2022-08-31 15:40:47 +10:00
|
|
|
python -m build
|
2023-02-17 12:03:25 +11:00
|
|
|
$(SED) "s/$(VERSION)/999999/" pyproject.toml
|
2023-02-15 20:06:07 +11:00
|
|
|
mv ../README.bak README.md
|
2023-02-17 12:03:25 +11:00
|
|
|
cd dist && mv ifcopenshell-0.7.0.$(VERSION)-py3-none-any.whl ifcopenshell-0.7.0.$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl
|
2022-08-31 15:40:47 +10:00
|
|
|
rm -rf dist/ifcopenshell
|
2022-10-03 23:40:29 +11:00
|
|
|
rm -rf dist/ifcopenshell.egg-info
|
|
|
|
|
rm -rf dist/ifcopenshell-0.7.0.tar.gz
|