Merge pull request #4459 from ryanpetrello/cli-version

make awxkit have the same version as the AWX package

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-08-12 15:15:41 +00:00 committed by GitHub
commit a776d0ba59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,5 @@
include requirements.txt
include setup.py
include VERSION
recursive-include awxkit *.py *.yml *.md
recursive-include test *.py *.yml *.md

1
awxkit/VERSION Symbolic link
View File

@ -0,0 +1 @@
../VERSION

View File

@ -10,6 +10,13 @@ except ImportError: # for pip <= 9.0.3
requirements = [str(r.req) for r in parse_requirements('requirements.txt', session=False)]
def get_version():
current_dir = os.path.dirname(os.path.abspath(__file__))
version_file = os.path.join(current_dir, 'VERSION')
with open(version_file, 'r') as file:
return file.read().strip()
class CleanCommand(Command):
description = "Custom clean command that forcefully removes dist/build directories"
user_options = []
@ -50,10 +57,9 @@ class CleanCommand(Command):
os.remove(rm)
version = '0.1.0'
setup(
name='awxkit',
version=version,
version=get_version(),
description='awx cli client',
packages=find_packages(exclude=['test']),
cmdclass={