This repository was archived by the owner on Nov 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (49 loc) · 1.53 KB
/
setup.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python
# coding=utf-8
"""
Setup script for comply.
https://github.com/jhauberg/comply
Copyright 2018 Jacob Hauberg Hansen.
License: MIT (see LICENSE)
"""
import sys
import re
from setuptools import setup, find_packages
from comply import VERSION_PATTERN, EXIT_CODE_FAILURE, is_compatible
from comply.printing import printdiag
if not is_compatible():
printdiag('Python 3.5 or newer required')
sys.exit(EXIT_CODE_FAILURE)
def determine_version_or_exit() -> str:
""" Determine version identifier or exit the program. """
with open('comply/version.py') as file:
version_contents = file.read()
version_match = re.search(VERSION_PATTERN, version_contents, re.M)
if version_match:
version = version_match.group(1)
return version
printdiag('Version could not be determined')
sys.exit(EXIT_CODE_FAILURE)
VERSION_IDENTIFIER = determine_version_or_exit()
setup(
name='comply',
version=VERSION_IDENTIFIER,
description='Compliant Style Guide',
long_description=open('README.md').read(),
url='https://github.com/jhauberg/comply',
download_url='https://github.com/jhauberg/comply/archive/master.zip',
author='Jacob Hauberg Hansen',
author_email='jacob.hauberg@gmail.com',
license='MIT',
packages=find_packages(),
include_package_data=True,
platforms='any',
install_requires=[
'docopt==0.6.2'
],
entry_points={
'console_scripts': [
'comply = comply.__main__:main',
],
}
)