-
Notifications
You must be signed in to change notification settings - Fork 31
/
setup.py
69 lines (65 loc) · 2.66 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
69
""" pygameweb
"""
import io
import os
import re
from itertools import chain
from setuptools import setup, find_packages
def read(*parts):
"""Reads a file from *parts."""
try:
return io.open(os.path.join(*parts), 'r', encoding='utf-8').read()
except IOError:
return ''
def get_version():
"""Returns the version from pygameweb/__init__.py."""
version_file = read('pygameweb', '__init__.py')
version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', version_file, re.MULTILINE)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')
def get_requirements():
"""Returns a list of requirements from requirements.txt files."""
requirements_files = ['requirements.txt']
requirements = []
for filename in requirements_files:
with open(filename) as file:
requirements.extend(line.strip() for line in file if not line.startswith('-r '))
return list(set(requirements))
setup(
name='pygameweb',
version=get_version(),
description='Pygame.org website.',
long_description=read('README.rst'),
author='Rene Dudfield',
author_email='[email protected]',
url='https://github.com/pygame/pygameweb',
packages=find_packages(),
package_data={'pygameweb': []},
include_package_data=True,
install_requires=get_requirements(),
classifiers=[
'Development Status :: 1 - Planning',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
],
data_files=[('.', ['alembic.ini'])],
entry_points={
'console_scripts': [
'pygameweb_front=pygameweb.run:run_front',
'pygameweb_generate_json=pygameweb.dashboard.generate_json:main',
'pygameweb_generate_static=pygameweb.dashboard.generate_static:main',
'pygameweb_launchpad=pygameweb.builds.launchpad_build_badge:check_pygame_builds',
'pygameweb_update_docs=pygameweb.builds.update_docs:update_docs',
'pygameweb_stackoverflow=pygameweb.builds.stackoverflow:download_stack_json',
'pygameweb_loadcomments=pygameweb.comment.models:load_comments',
'pygameweb_trainclassifier=pygameweb.comment.classifier_train:classify_comments',
'pygameweb_worker=pygameweb.tasks.worker:work',
'pygameweb_release_version_correct=pygameweb.builds.update_version_from_git:release_version_correct',
'pygameweb_github_releases=pygameweb.project.gh_releases:sync_github_releases',
'pygameweb_fixtures=pygameweb.fixtures:populate_db',
],
},
license='BSD',
)