This repository has been archived by the owner on Nov 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
62 lines (46 loc) · 1.43 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
#!/usr/bin/env python
# coding=utf-8
"""
Setup script for cards.py.
https://github.com/jhauberg/cards.py
Copyright 2015 Jacob Hauberg Hansen.
License: MIT (see LICENSE)
"""
import sys
import re
from setuptools import setup
from cards.constants import VERSION_PATTERN
def determine_version_or_exit() -> str:
""" Determine version identifier or exit the program. """
if sys.version_info < (3, 5):
sys.exit('Python 3.5 or newer is required for cards.py')
with open('cards/version.py') as file:
version_contents = file.read()
version_match = re.search(VERSION_PATTERN, version_contents, re.M)
if version_match:
return version_match.group(1)
else:
sys.exit('Version could not be determined')
VERSION_IDENTIFIER = determine_version_or_exit()
setup(
name='cards.py',
version=VERSION_IDENTIFIER,
description='Generate Print-and-Play cards for your board games',
long_description=open('README.md').read(),
url='https://github.com/jhauberg/cards.py',
download_url='https://github.com/jhauberg/cards.py/archive/master.zip',
author='Jacob Hauberg Hansen',
author_email='[email protected]',
license='MIT',
packages=['cards'],
include_package_data=True,
platforms='any',
install_requires=[
'docopt==0.6.2'
],
entry_points={
'console_scripts': [
'cards = cards.__main__:main',
],
}
)