From b009913cf41fc019fcf03326b9453b99498d154f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 11 Jun 2024 13:11:14 +1000 Subject: [PATCH] Fix #4511. IfcOpenShell builds now read from the VERSION file and expose a __version__ var. --- src/blenderbim/Makefile | 18 +++++++++--------- src/blenderbim/blenderbim/__init__.py | 2 +- .../blenderbim/blender_manifest.toml | 2 +- src/ifcopenshell-python/Makefile | 14 ++++++++------ .../ifcopenshell/__init__.py | 3 ++- src/ifcopenshell-python/pyproject.toml | 2 +- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/blenderbim/Makefile b/src/blenderbim/Makefile index 10d47852d0..73c75486e8 100644 --- a/src/blenderbim/Makefile +++ b/src/blenderbim/Makefile @@ -36,11 +36,11 @@ endif endif IS_DEV_BUILD:=TRUE -VERSION:=`cat '../../VERSION'` -VERSION_MAJOR:=`cat '../../VERSION' | cut -d '.' -f 1` -VERSION_MINOR:=`cat '../../VERSION' | cut -d '.' -f 2` -VERSION_PATCH:=`cat '../../VERSION' | cut -d '.' -f 3` -VERSION_DATE:=`date '+%y%m%d'` +VERSION:=$(shell cat ../../VERSION) +VERSION_MAJOR:=$(shell cat '../../VERSION' | cut -d '.' -f 1) +VERSION_MINOR:=$(shell cat '../../VERSION' | cut -d '.' -f 2) +VERSION_PATCH:=$(shell cat '../../VERSION' | cut -d '.' -f 3) +VERSION_DATE:=$(shell date '+%y%m%d') LAST_COMMIT_HASH:=$(shell git rev-parse HEAD) PYVERSION:=py310 PYPI_IMP:=cp @@ -287,13 +287,13 @@ endif rm -rf dist/blenderbim/libs/site/packages/numpy.libs ifeq ($(IS_DEV_BUILD), TRUE) - cd dist/blenderbim && $(SED) "s/9, 9, 9/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH), $(VERSION_DATE)/" __init__.py - cd dist/blenderbim && $(SED) "s/9.9.9/$(VERSION).$(VERSION_DATE)/" blender_manifest.toml + cd dist/blenderbim && $(SED) "s/0, 0, 0/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH), $(VERSION_DATE)/" __init__.py + cd dist/blenderbim && $(SED) "s/0.0.0/$(VERSION).$(VERSION_DATE)/" blender_manifest.toml cd dist/blenderbim/bim && $(SED) "s/8888888/$(LAST_COMMIT_HASH)/" __init__.py cd dist && zip -r blenderbim-$(VERSION).$(VERSION_DATE)-$(PYVERSION)-$(PLATFORM).zip ./* else - cd dist/blenderbim && $(SED) "s/9, 9, 9/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH)/" __init__.py - cd dist/blenderbim && $(SED) "s/9.9.9/$(VERSION)/" blender_manifest.toml + cd dist/blenderbim && $(SED) "s/0, 0, 0/$(VERSION_MAJOR), $(VERSION_MINOR), $(VERSION_PATCH)/" __init__.py + cd dist/blenderbim && $(SED) "s/0.0.0/$(VERSION)/" blender_manifest.toml cd dist && zip -r blenderbim-$(VERSION)-$(PYVERSION)-$(PLATFORM).zip ./* endif rm -rf dist/blenderbim diff --git a/src/blenderbim/blenderbim/__init__.py b/src/blenderbim/blenderbim/__init__.py index db7ca7fdcc..5142ddfc5d 100644 --- a/src/blenderbim/blenderbim/__init__.py +++ b/src/blenderbim/blenderbim/__init__.py @@ -38,7 +38,7 @@ bl_info = { "description": "Transforms Blender into a native Building Information Model authoring platform using IFC.", "author": "IfcOpenShell Contributors", "blender": (3, 1, 0), - "version": (9, 9, 9), + "version": (0, 0, 0), "location": "File Menu, Scene Properties Tab. See documentation for more.", "doc_url": "https://docs.blenderbim.org/", "tracker_url": "https://github.com/IfcOpenShell/IfcOpenShell/issues", diff --git a/src/blenderbim/blenderbim/blender_manifest.toml b/src/blenderbim/blenderbim/blender_manifest.toml index 3f30484bf7..aa72a7c2c7 100644 --- a/src/blenderbim/blenderbim/blender_manifest.toml +++ b/src/blenderbim/blenderbim/blender_manifest.toml @@ -1,6 +1,6 @@ schema_version = "1.0.0" id = "blenderbim" -version = "9.9.9" +version = "0.0.0" name = "BlenderBIM" tagline = "Transforms Blender into a native Building Information Model authoring platform using IFC." maintainer = "Dion Moult " diff --git a/src/ifcopenshell-python/Makefile b/src/ifcopenshell-python/Makefile index 27bd282a92..62cc08626a 100644 --- a/src/ifcopenshell-python/Makefile +++ b/src/ifcopenshell-python/Makefile @@ -1,5 +1,5 @@ -VERSION:=`date '+%y%m%d'` -PYVERSION:=py310 +VERSION:=$(shell cat ../../VERSION) +PYVERSION:=py311 PLATFORM:=linux SED:=sed -i @@ -101,11 +101,13 @@ endif # distutils cannot access anything outside the cwd, so hackishly swap out the README.md cp README.md ../README.bak cp ../../README.md README.md - $(SED) "s/999999/$(VERSION)/" pyproject.toml + cp pyproject.toml pyproject.toml.bak + $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' pyproject.toml + $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' dist/ifcopenshell/__init__.py python -m build - $(SED) "s/$(VERSION)/999999/" pyproject.toml + mv pyproject.toml.bak pyproject.toml mv ../README.bak README.md - cd dist && mv ifcopenshell-0.7.0.$(VERSION)-py3-none-any.whl ifcopenshell-0.7.0.$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl + cd dist && mv ifcopenshell-$(VERSION)-py3-none-any.whl ifcopenshell-$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl rm -rf dist/ifcopenshell rm -rf dist/ifcopenshell.egg-info - rm -rf dist/ifcopenshell-0.7.0.$(VERSION).tar.gz + rm -rf dist/ifcopenshell-$(VERSION).tar.gz diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index 310eb4bb37..aa81dd762b 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -284,5 +284,6 @@ def guess_format(path: Path) -> Union[str, None]: return None -version = ifcopenshell_wrapper.version() +version_core = ifcopenshell_wrapper.version() +__version__ = version = "0.0.0" get_log = ifcopenshell_wrapper.get_log diff --git a/src/ifcopenshell-python/pyproject.toml b/src/ifcopenshell-python/pyproject.toml index fc1bff6807..8a6ebdd48b 100644 --- a/src/ifcopenshell-python/pyproject.toml +++ b/src/ifcopenshell-python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "ifcopenshell" -version = "0.7.0.999999" +version = "0.0.0" authors = [ { name="Dion Moult", email="dion@thinkmoult.com" }, ]