forked from SharpBit/brawlstats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
57 lines (51 loc) · 1.9 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
from setuptools import setup, find_packages
import json
import re
import urllib.request
with open('README.rst', encoding='utf8') as f:
long_description = f.read()
with open('brawlstats/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
requirements = []
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
name='brawlstats',
version=version,
description='An easy-to-use wrapper for the unofficial Brawl Stars API',
long_description=long_description,
long_description_content_type='text/x-rst',
url='https://github.com/SharpBit/brawlstats',
author='SharpBit',
author_email='[email protected]',
license='MIT',
keywords=['brawl stars, brawlstats, supercell'],
packages=find_packages(),
install_requires=requirements,
python_requires='>=3.5',
project_urls={
'Source Code': 'https://github.com/SharpBit/brawlstats',
'Issue Tracker': 'https://github.com/SharpBit/brawlstats/issues',
'Documentation': 'https://brawlstats.readthedocs.io/',
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Games/Entertainment :: Real Time Strategy',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Natural Language :: English'
]
)
# Reload Constants
try:
data = json.loads(urllib.request.urlopen('https://fourjr-webserver.herokuapp.com/bs/constants').read())
except (TypeError, urllib.error.HTTPError, urllib.error.URLError):
pass
else:
if data:
with open('brawlstats/constants.json', 'w') as f:
json.dump(data, f)