Created
May 12, 2021 09:15
-
-
Save mvk/b443653026e96f2abadfb6cd7d9f80ad to your computer and use it in GitHub Desktop.
setup.py
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
#!/usr/bin/env python | |
# vim: ts=4 sw=4 et | |
import setuptools | |
import configparser | |
import os | |
parser = configparser.ConfigParser() | |
setup_cfg = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'setup.cfg') | |
parser.read(setup_cfg) | |
version = parser['metadata'].get('version') | |
setuptools_params = dict( | |
setup_requires=[ | |
'setuptools>=17.1', | |
'pbr', | |
], | |
pbr=True | |
) | |
if version: | |
# version has been set in setup.cfg | |
setuptools_params.pop('pbr') | |
setuptools_params.update( | |
setup_requires=[ | |
'setuptools>=17.1', | |
], | |
) | |
setuptools.setup(**setuptools_params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment