adapt make install, uninstall, pypi
@@ -7,6 +7,10 @@ LOG_LEVEL = INFO
PYTHONIOENCODING=utf8
TESTDIR = tests
+BUILD_ORDER = ocrd_utils ocrd_models ocrd_modelfactory ocrd_validators ocrd
+
+FIND_VERSION = grep version= ocrd_utils/setup.py|grep -Po "([0-9ab]+\.?)+"
+
# BEGIN-EVAL makefile-parser --make-help Makefile
help:
@@ -49,11 +53,11 @@ deps-test:
# (Re)install the tool
install: spec
- (cd ocrd_utils ; pip install .)
- (cd ocrd_models ; pip install .)
- (cd ocrd_modelfactory ; pip install .)
- (cd ocrd_validators ; pip install .)
- (cd ocrd ; pip install .)
+ for mod in $(BUILD_ORDER);do (cd $$mod ; pip install .);done
+
+# Uninstall the tool
+uninstall:
+ for mod in $(BUILD_ORDER);do pip uninstall -y $$mod;done
# Regenerate python code from PAGE XSD
generate-page: repo/assets
@@ -168,9 +172,7 @@ docker:
bashlib:
cd bashlib; make lib
-# Build wheels in py2 and py3 venv and twine upload them
-pypi:
- source $(HOME)/env/py3/bin/activate;python setup.py build bdist_wheel
- source $(HOME)/env/py2/bin/activate;python setup.py build bdist_wheel
- $(PYTHON) setup.py sdist
- version=`grep version= setup.py|grep -Po "([0-9]+\.?)+"`; twine upload "dist/ocrd-$$version"*
+# Build wheels and source dist and twine upload them
+pypi: uninstall install
+ for mod in $(BUILD_ORDER);do (cd $$mod; $(PYTHON) setup.py sdist bdist_wheel);done
+ version=`$(FIND_VERSION)`; echo twine upload ocrd*/dist/ocrd*$$version*{tar.gz,whl}
