diff --git a/setup.py b/setup.py index 7cd88ab4..f16ff247 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,8 @@ ] rpm_require.extend(__base_pip_requires) + + # This metadata can be read out with: # import importlib.metadata # dir(importlib.metadata.metadata('decisionengine_modules')) @@ -78,6 +80,19 @@ # importlib_resources on python < 3.9 # # Much of it comes out of decisionengine_modules.about.py + +# for decisionengine dev we have version in the form X.Y.Z.devN +# while for tag we have version in the form X.Y.Z +verarr=about.__version__.split(".")[:4] +if len(verarr)>3: + # this is a dev version + ver='.'.join(verarr[:3]+[verarr[3][:3]]) +else: + # this is a tag + ver='.'.join(verarr[:3]) +# string to add decisionengine as decisionengine_modules requirement +de_req=[f"decisionengine>="+ver] + setup( setup_requires=["setuptools >= 51.2", "wheel >= 0.36.2", "setuptools_scm >= 6.3.1"], python_requires=">3.7.0", @@ -89,7 +104,7 @@ license=about.__license__, package_dir={"": "src"}, packages=find_packages(where="src", exclude=("tests", "*.tests", "*.tests.*", "build.*", "doc.*")), - install_requires=runtime_require, + install_requires=runtime_require+de_req, extras_require={ "develop": devel_req, },