forked from skupperproject/skupper-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes skupperproject#1251: Don't pass in version if already passed in…
… version in incompatible
- Loading branch information
1 parent
abf0523
commit 2c69368
Showing
1 changed file
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
|
||
from setuptools import setup | ||
from setuptools.command.build_py import build_py | ||
from setuptools.extern.packaging.version import InvalidVersion | ||
from os.path import join | ||
from os import environ | ||
|
||
|
@@ -45,21 +46,41 @@ destdir = environ.get("DESTDIR") | |
if destdir: | ||
options["install"] = {"root": destdir} | ||
|
||
setup( | ||
options=options, | ||
try: | ||
setup( | ||
options=options, | ||
name='skupper_router', | ||
description='Skupper Router tools and libraries.', | ||
package_dir={'' : '${CMAKE_SOURCE_DIR}/python'}, | ||
packages=['skupper_router', 'skupper_router.management'], | ||
package_data={'skupper_router.management': ['*.json']}, | ||
cmdclass={'build_py': BuildPy}, | ||
version='${QPID_DISPATCH_VERSION}', | ||
author='Skupper Project', | ||
author_email='[email protected]', | ||
url='https://skupper.io/', | ||
license='Apache Software License', | ||
zip_safe=False, | ||
) | ||
except InvalidVersion: | ||
# When on a branch, and no version is provided via the -DVERSION, the router's version is set to | ||
# commit-sha(<branch-name>), e.g. 2gf3445634mndfkgfh(main) | ||
# That version is no PEP-440 compatible and so setuptools fails the build. | ||
# We are catching the InvalidVersion error and not passing in a version | ||
# The router's version can be obtained via skrouterd --version | ||
# What is the reason to provide version here ? | ||
setup( | ||
options=options, | ||
name='skupper_router', | ||
description='Skupper Router tools and libraries.', | ||
package_dir={'': '${CMAKE_SOURCE_DIR}/python'}, | ||
packages=['skupper_router', 'skupper_router.management'], | ||
package_data={'skupper_router.management': ['*.json']}, | ||
cmdclass={'build_py': BuildPy}, | ||
author='Skupper Project', | ||
author_email='[email protected]', | ||
url='https://skupper.io/', | ||
license='Apache Software License', | ||
zip_safe=False, | ||
) | ||
|
||
name='skupper_router', | ||
description='Skupper Router tools and libraries.', | ||
package_dir={'' : '${CMAKE_SOURCE_DIR}/python'}, | ||
packages=['skupper_router', 'skupper_router.management'], | ||
package_data={'skupper_router.management': ['*.json']}, | ||
cmdclass={'build_py': BuildPy}, | ||
|
||
version='${QPID_DISPATCH_VERSION}', | ||
author='Skupper Project', | ||
author_email='[email protected]', | ||
url='https://skupper.io/', | ||
license='Apache Software License', | ||
|
||
zip_safe=False, | ||
) |