From 39a626edeb2db9f1404f5a29e12d9ff1fe1bb39d Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 31 Aug 2022 15:40:47 +1000 Subject: [PATCH] Super simple wheel creator for PyPi --- src/ifcopenshell-python/Makefile | 56 ++++++++++++++++++++++++++ src/ifcopenshell-python/pyproject.toml | 24 +++++++++++ 2 files changed, 80 insertions(+) create mode 100644 src/ifcopenshell-python/pyproject.toml diff --git a/src/ifcopenshell-python/Makefile b/src/ifcopenshell-python/Makefile index 2d39b45dd7..35b8c48d94 100644 --- a/src/ifcopenshell-python/Makefile +++ b/src/ifcopenshell-python/Makefile @@ -1,3 +1,34 @@ +VERSION:=`date '+%y%m%d'` +PYVERSION:=py310 +PLATFORM:=linux + +ifeq ($(PYVERSION), py36) +PYNUMBER:=36 +ABITAG:=cp36m +endif +ifeq ($(PYVERSION), py37) +PYNUMBER:=37 +endif +ifeq ($(PYVERSION), py38) +PYNUMBER:=38 +endif +ifeq ($(PYVERSION), py39) +PYNUMBER:=39 +endif +ifeq ($(PYVERSION), py310) +PYNUMBER:=31 +endif + +ifeq ($(PLATFORM), linux) +PLATFORMTAG:=manylinux1_x86_64 +endif +ifeq ($(PLATFORM), macos) +PLATFORMTAG:=macosx_10_15_x86_64 +endif +ifeq ($(PLATFORM), win) +PLATFORMTAG:=win_amd64 +endif + .PHONY: test test: pytest -p no:pytest-blender test @@ -26,3 +57,28 @@ coverage: .PHONY: clean clean: rm -rf htmlcov + +.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/ + + cd dist/working && wget https://s3.amazonaws.com/ifcopenshell-builds/ifcopenshell-python-$(PYNUMBER)-v0.7.0-dc67287-$(PLATFORM)64.zip + 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 + python -m build + cd dist && mv ifcopenshell-0.7.0-py3-none-any.whl ifcopenshell-0.7.0-$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl + rm -rf dist/ifcopenshell + rm -rf dist/ifcopenshell.egg-info + rm -rf dist/ifcopenshell-0.7.0.tar.gz diff --git a/src/ifcopenshell-python/pyproject.toml b/src/ifcopenshell-python/pyproject.toml new file mode 100644 index 0000000000..8d94dc23a6 --- /dev/null +++ b/src/ifcopenshell-python/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" +[project] +name = "ifcopenshell" +version = "0.7.0" +authors = [ + { name="Dion Moult", email="dion@thinkmoult.com" }, +] +description = "Python bindings, utility functions, and high-level API for IfcOpenShell" +readme = "README.md" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", +] +[project.urls] +"Homepage" = "http://ifcopenshell.org" +"Bug Tracker" = "https://github.com/ifcopenshell/ifcopenshell/issues" +[tool.setuptools.packages.find] +where = ["dist"] +include = ["ifcopenshell*"] +[tool.setuptools.package-data] +ifcopenshell = ["*.pyd", "*.so", "*.json"] +"ifcopenshell.util" = ["*.json", "schema/*.ifc"]