File: setup.py

package info (click to toggle)
devscripts 2.19.5%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,672 kB
  • sloc: perl: 23,839; sh: 10,063; python: 1,574; makefile: 318; ansic: 11
file content (29 lines) | stat: -rwxr-xr-x 695 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python3

import os
import re

from setuptools import setup

from devscripts.test import SCRIPTS


def get_version():
    # look/set what version we have
    changelog = "../debian/changelog"
    if os.path.exists(changelog):
        head = open(changelog, encoding="utf8").readline()
        match = re.compile(r".*\((.*)\).*").match(head)
        if match:
            return match.group(1)
    raise Exception("Failed to determine version from debian/changelog")


if __name__ == '__main__':
    setup(
        name='devscripts',
        version=get_version(),
        scripts=SCRIPTS,
        packages=['devscripts', 'devscripts/test'],
        test_suite='devscripts.test',
    )