mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
fix potential blenderbim issues for python 3.10
tomllib was added to python 3.11, tomli can be used for the previous versions. Though it is a bit questionable since internally Blender is using just tomllib and because of that I'm not sure anymore if Blender still supports Python 3.10.
This commit is contained in:
@@ -189,6 +189,10 @@ else ifeq ($(PLATFORM), macos)
|
|||||||
else
|
else
|
||||||
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pyradiance $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
|
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download pyradiance $(PYPI_PLATFORM) --python-version $(PYPI_VERSION) --implementation $(PYPI_IMP) --only-binary=:all: --dest=./wheels
|
||||||
endif
|
endif
|
||||||
|
# tomllib replacement for < Python 3.11, used to parse blender_manifest
|
||||||
|
ifeq ($(PYVERSION), py310)
|
||||||
|
cd build && . env/$(VENV_ACTIVATE) && $(PIP) download tomli --dest=./wheels
|
||||||
|
endif
|
||||||
|
|
||||||
# Provides jsgantt-improved supports for web-based construction sequencing gantt charts
|
# Provides jsgantt-improved supports for web-based construction sequencing gantt charts
|
||||||
cd build/blenderbim/bim/data/gantt/ && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
|
cd build/blenderbim/bim/data/gantt/ && wget https://raw.githubusercontent.com/jsGanttImproved/jsgantt-improved/master/dist/jsgantt.js
|
||||||
|
|||||||
@@ -68,11 +68,14 @@ def initialize_bbim_semver():
|
|||||||
in `addon_utils.modules()->bl_info['version']`,
|
in `addon_utils.modules()->bl_info['version']`,
|
||||||
therefore we just parse it from .toml.
|
therefore we just parse it from .toml.
|
||||||
"""
|
"""
|
||||||
import tomllib
|
if sys.version_info >= (3, 11):
|
||||||
|
import tomllib as toml
|
||||||
|
else:
|
||||||
|
import tomli as toml
|
||||||
|
|
||||||
toml_path = Path(__file__).parent / "blender_manifest.toml"
|
toml_path = Path(__file__).parent / "blender_manifest.toml"
|
||||||
with open(toml_path, "rb") as f:
|
with open(toml_path, "rb") as f:
|
||||||
manifest = tomllib.load(f)
|
manifest = toml.load(f)
|
||||||
semver_pattern = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
|
semver_pattern = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
|
||||||
version_str = manifest["version"]
|
version_str = manifest["version"]
|
||||||
re_version = re.match(semver_pattern, version_str)
|
re_version = re.match(semver_pattern, version_str)
|
||||||
|
|||||||
Reference in New Issue
Block a user