Commit 160a64c2 authored by Maciej Delmanowski's avatar Maciej Delmanowski

Improve Python package built from official tarball

The Python package built from the official .tar.gz release of DebOps
will now use the correct version, based on the contents of the
CHANGELOG.rst file. The package will also include Ansible roles and
playbooks maintained by the project.
parent b79efe20
......@@ -2,6 +2,7 @@
from setuptools import setup, find_packages
import os
import re
import subprocess
......@@ -37,14 +38,23 @@ except subprocess.CalledProcessError:
RELEASE = open('VERSION').read().strip()
except Exception:
RELEASE = '0.0.0'
with file('CHANGELOG.rst') as changelog:
for count, line in enumerate(changelog):
if'^`debops v', line):
RELEASE = line.split()[1].rstrip(b'`_').lstrip(b'v')
with open('VERSION', 'w') as version_file:
except Exception:
RELEASE = '0.0.0'
# Symlink the 'ansible/' directory inside of the 'debops/' Python package
# directory. The files will be included in the package using the
# file. This requires 'python-setuptools' APT package from
# 'jessie-backports' repository.
if os.path.exists('.git') and os.path.isdir('.git'):
if not os.path.exists('debops/ansible'):
os.symlink('../ansible', 'debops/ansible')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment