From 5d4a3d504c8f52890ecdd81b2800010794f6e993 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 23 Jul 2024 17:00:22 +1000 Subject: [PATCH] Support alpha versions for all wheels --- .github/workflows/ci-bcf-pypi.yml | 2 +- .github/workflows/ci-bsdd-pypi.yaml | 2 +- .github/workflows/ci-ifc4d-pypi.yaml | 2 +- .github/workflows/ci-ifc5d-pypi.yaml | 2 +- .github/workflows/ci-ifccityjson-pypi.yaml | 2 +- .github/workflows/ci-ifcclash-pypi.yaml | 2 +- .github/workflows/ci-ifccsv-pypi.yaml | 2 +- .github/workflows/ci-ifcdiff-pypi.yaml | 2 +- .github/workflows/ci-ifcfm-pypi.yaml | 2 +- .github/workflows/ci-ifcopenshell-python-pypi.yml | 2 +- .github/workflows/ci-ifcpatch-pypi.yaml | 2 +- .github/workflows/ci-ifctester-pypi.yml | 2 +- src/blenderbim/Makefile | 4 ++++ src/common.mk | 11 +++++++++++ src/ifcopenshell-python/Makefile | 15 +++++++++++++-- 15 files changed, 40 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-bcf-pypi.yml b/.github/workflows/ci-bcf-pypi.yml index 7fed2dc053..4b70c77e0a 100644 --- a/.github/workflows/ci-bcf-pypi.yml +++ b/.github/workflows/ci-bcf-pypi.yml @@ -32,7 +32,7 @@ jobs: run: | pip install build cd src/bcf && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-bsdd-pypi.yaml b/.github/workflows/ci-bsdd-pypi.yaml index 67da096296..a1f68bf236 100644 --- a/.github/workflows/ci-bsdd-pypi.yaml +++ b/.github/workflows/ci-bsdd-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/bsdd && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifc4d-pypi.yaml b/.github/workflows/ci-ifc4d-pypi.yaml index 79707a5881..d2fa648ddb 100644 --- a/.github/workflows/ci-ifc4d-pypi.yaml +++ b/.github/workflows/ci-ifc4d-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifc4d && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifc5d-pypi.yaml b/.github/workflows/ci-ifc5d-pypi.yaml index b626316267..c4669e1af2 100644 --- a/.github/workflows/ci-ifc5d-pypi.yaml +++ b/.github/workflows/ci-ifc5d-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifc5d && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifccityjson-pypi.yaml b/.github/workflows/ci-ifccityjson-pypi.yaml index 2003acf169..f3c921b094 100644 --- a/.github/workflows/ci-ifccityjson-pypi.yaml +++ b/.github/workflows/ci-ifccityjson-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifccityjson && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifcclash-pypi.yaml b/.github/workflows/ci-ifcclash-pypi.yaml index bd2875e138..e53c12ab67 100644 --- a/.github/workflows/ci-ifcclash-pypi.yaml +++ b/.github/workflows/ci-ifcclash-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifcclash && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifccsv-pypi.yaml b/.github/workflows/ci-ifccsv-pypi.yaml index 50803918d7..d1a40f94ab 100644 --- a/.github/workflows/ci-ifccsv-pypi.yaml +++ b/.github/workflows/ci-ifccsv-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifccsv && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifcdiff-pypi.yaml b/.github/workflows/ci-ifcdiff-pypi.yaml index 654357409b..6fc88a6059 100644 --- a/.github/workflows/ci-ifcdiff-pypi.yaml +++ b/.github/workflows/ci-ifcdiff-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifcdiff && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifcfm-pypi.yaml b/.github/workflows/ci-ifcfm-pypi.yaml index 177ba6d01e..576d150dc4 100644 --- a/.github/workflows/ci-ifcfm-pypi.yaml +++ b/.github/workflows/ci-ifcfm-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifcfm && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifcopenshell-python-pypi.yml b/.github/workflows/ci-ifcopenshell-python-pypi.yml index 6a87361157..73199521bb 100644 --- a/.github/workflows/ci-ifcopenshell-python-pypi.yml +++ b/.github/workflows/ci-ifcopenshell-python-pypi.yml @@ -57,7 +57,7 @@ jobs: pip install build cp -r src/ifcopenshell-python src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }} && cd src/ifcopenshell_${{ matrix.config.short_name }}_${{ matrix.pyver }} && - make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} + make dist PLATFORM=${{ matrix.config.short_name }} PYVERSION=${{ matrix.pyver }} IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifcpatch-pypi.yaml b/.github/workflows/ci-ifcpatch-pypi.yaml index 2b39a77bea..cdeb78c27d 100644 --- a/.github/workflows/ci-ifcpatch-pypi.yaml +++ b/.github/workflows/ci-ifcpatch-pypi.yaml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifcpatch && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/.github/workflows/ci-ifctester-pypi.yml b/.github/workflows/ci-ifctester-pypi.yml index f7e29ac111..51835418e7 100644 --- a/.github/workflows/ci-ifctester-pypi.yml +++ b/.github/workflows/ci-ifctester-pypi.yml @@ -26,7 +26,7 @@ jobs: run: | pip install build cd src/ifctester && - make dist + make dist IS_STABLE=TRUE - name: Publish a Python distribution to PyPI uses: ortega2247/pypi-upload-action@master with: diff --git a/src/blenderbim/Makefile b/src/blenderbim/Makefile index 1388975b42..f1e4f1a01f 100644 --- a/src/blenderbim/Makefile +++ b/src/blenderbim/Makefile @@ -251,7 +251,11 @@ endif $(SED) "s/os-arch/$(BLENDER_PLATFORM)/" build/blenderbim/blender_manifest.toml # Provides BlenderBIM Add-on functionality +ifeq ($(IS_STABLE), TRUE) $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/pyproject.toml +else + $(SED) 's/version = "0.0.0"/version = "$(VERSION)a$(VERSION_DATE)"/' build/pyproject.toml +endif cd build && . env/$(VENV_ACTIVATE) && $(PYTHON) -m build cp build/dist/*.whl build/wheels/ diff --git a/src/common.mk b/src/common.mk index 22428cdbdb..0d8742a40f 100644 --- a/src/common.mk +++ b/src/common.mk @@ -1,6 +1,8 @@ +IS_STABLE:=FALSE PYTHON:=python3.11 PIP:=pip3.11 VERSION:=$(shell cat ../../VERSION) +VERSION_DATE:=$(shell date '+%y%m%d') SED:=sed -i VENV_BIN:=bin @@ -23,11 +25,20 @@ dist: mkdir -p dist cp -r $(PACKAGE_NAME) build/ cp pyproject.toml build/ +ifeq ($(IS_STABLE), TRUE) $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/pyproject.toml ifdef IS_MODULE $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/$(PACKAGE_NAME) else $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/$(PACKAGE_NAME)/__init__.py +endif +else + $(SED) 's/version = "0.0.0"/version = "$(VERSION)a$(VERSION_DATE)"/' build/pyproject.toml +ifdef IS_MODULE + $(SED) 's/version = "0.0.0"/version = "$(VERSION)-alpha$(VERSION_DATE)"/' build/$(PACKAGE_NAME) +else + $(SED) 's/version = "0.0.0"/version = "$(VERSION)-alpha$(VERSION_DATE)"/' build/$(PACKAGE_NAME)/__init__.py +endif endif cd build && $(PYTHON) -m venv env && . env/$(VENV_ACTIVATE) && $(PIP) install build cd build && . env/$(VENV_ACTIVATE) && $(PYTHON) -m build diff --git a/src/ifcopenshell-python/Makefile b/src/ifcopenshell-python/Makefile index 93df7edfaf..4e125af5b5 100644 --- a/src/ifcopenshell-python/Makefile +++ b/src/ifcopenshell-python/Makefile @@ -1,4 +1,6 @@ +IS_STABLE:=FALSE VERSION:=$(shell cat ../../VERSION) +VERSION_DATE:=$(shell date '+%y%m%d') PYVERSION:=py311 PLATFORM:=linux64 @@ -120,11 +122,20 @@ endif cp -r build/botbuild/ifcopenshell/*ifcopenshell_wrapper* build/ifcopenshell/ cp ../../README.md build/ cp pyproject.toml build/ +ifeq ($(IS_STABLE), TRUE) $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/pyproject.toml $(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' build/ifcopenshell/__init__.py +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 cd build && $(PYTHON) -m venv env && . env/$(VENV_ACTIVATE) && $(PIP) install build cd build && . env/$(VENV_ACTIVATE) && $(PYTHON) -m build - mv build/dist/ifcopenshell-$(VERSION)-py3-none-any.whl dist/ifcopenshell-$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl - rm -rf build +ifeq ($(IS_STABLE), TRUE) + mv build/dist/ifcopenshell-*.whl dist/ifcopenshell-$(VERSION)-$(PYVERSION)-none-$(PLATFORMTAG).whl +else + cp build/dist/ifcopenshell-*.whl dist/ifcopenshell-$(VERSION)a$(VERSION_DATE)-$(PYVERSION)-none-$(PLATFORMTAG).whl +endif + # rm -rf build