make awxkit have the same version as the AWX package

This commit is contained in:
Ryan Petrello 2019-08-12 09:26:40 -04:00
parent 28e3625066
commit b90d1456b3
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777
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={