mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Share common makefile instructions, use venv for running build, and separate dist/build dirs
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
PYTHON:=python3.11
|
||||
PIP:=pip3.11
|
||||
VERSION:=$(shell cat ../../VERSION)
|
||||
SED:=sed -i
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
SED:=sed -i '' -e
|
||||
PYTHON:=python3
|
||||
endif
|
||||
|
||||
.PHONY: dist
|
||||
dist:
|
||||
rm -rf build
|
||||
mkdir -p build
|
||||
mkdir -p dist
|
||||
cp -r $(PACKAGE_NAME) build/
|
||||
cp pyproject.toml build/
|
||||
$(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
|
||||
cd build && $(PYTHON) -m venv env && . env/bin/activate && $(PIP) install build
|
||||
cd build && . env/bin/activate && $(PYTHON) -m build
|
||||
cp build/dist/*.whl dist/
|
||||
rm -rf build
|
||||
Reference in New Issue
Block a user