-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
91 lines (78 loc) · 2.65 KB
/
setup.py
File metadata and controls
91 lines (78 loc) · 2.65 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# to build the distrubution @ dist/gaming_spiders-*.*.*.tar.gz
#
# >git clone https://github.com/simonsdave/gaming_spiders.git
# >cd gaming_spiders
# >python setup.py bdist_wheel sdist --formats=gztar sdist --formats=gztar
#
import os
import re
from setuptools import setup
#
# makes accessing a couple of files easier
#
abs_dirname_for_this_file = os.path.dirname(os.path.abspath(__file__))
#
# this approach used below to determine ```version``` was inspired by
# https://github.com/kennethreitz/requests/blob/master/setup.py#L31
#
# why this complexity? wanted version number to be available in the
# a runtime.
#
# the code below assumes the distribution is being built with the
# current directory being the directory in which setup.py is stored
# which should be totally fine 99.9% of the time. not going to add
# the coode complexity to deal with other scenarios
#
reg_ex_pattern = r'__version__\s*=\s*[\'"](?P<version>[^\'"]*)[\'"]'
reg_ex = re.compile(reg_ex_pattern)
version = ''
with open(os.path.join(abs_dirname_for_this_file, 'gaming_spiders', '__init__.py'), 'r', encoding='utf-8') as fd:
for line in fd:
match = reg_ex.match(line)
if match:
version = match.group('version')
break
if not version:
raise Exception("Can't locate project's version number")
_author = 'Dave Simons'
_author_email = 'simonsdave@gmail.com'
def _get_long_description():
try:
# README.rst uses UTF-8 character encoding since
# the file is generated by pandoc (see the "Character encoding"
# of https://pandoc.org/MANUAL.html).
with open(os.path.join(abs_dirname_for_this_file, 'README.rst'), 'r', encoding='utf-8') as f:
return f.read()
except IOError:
# simple fix for avoid failure on "source cfg4dev"
return 'a long description'
_long_description = _get_long_description()
setup(
name='gaming_spiders',
packages=[
'gaming_spiders',
],
scripts=[
'gaming_spiders/gamehouseonlinegames.py',
'gaming_spiders/hiddenobjectgames.py',
'gaming_spiders/match3games.py',
'gaming_spiders/miniclip.py',
'gaming_spiders/solitaireonline.py',
'gaming_spiders/gamesonly.py',
'gaming_spiders/mahjonggames.py',
'gaming_spiders/mindgames.py',
'gaming_spiders/msnonlinegames.py',
],
install_requires=[
'cloudfeaster==0.9.59',
],
version=version,
description='Gaming Spiders',
long_description=_long_description,
author=_author,
author_email=_author_email,
maintainer=_author,
maintainer_email=_author_email,
url='https://github.com/simonsdave/gaming_spiders'
)