Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Dynamically determine version from __init__.py
Browse files Browse the repository at this point in the history
Improved way of automatically building the python
package based on the __version__ maintained in
__init__.py

Signed-off-by: Paul Cuzner <[email protected]>
  • Loading branch information
pcuzner committed Feb 11, 2019
1 parent c52d87f commit cea5033
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/python

from setuptools import setup

import distutils.command.install_scripts
import shutil
import re

module_file = open("runner_service/__init__.py").read()
metadata = dict(re.findall(r"__([a-z]+)__\s*=\s*'([^']+)'", module_file))


# idea from http://stackoverflow.com/a/11400431/2139420
Expand All @@ -20,7 +25,7 @@ def run(self):

setup(
name="ansible-runner-service",
version=0.9,
version=metadata['version'],
description="Ansible runner based REST API",
long_description="Ansible runner based light weight RESTful web service",
author="Paul Cuzner",
Expand Down

0 comments on commit cea5033

Please sign in to comment.