forked from fabiommendes/FGAme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py.bak
93 lines (84 loc) · 2.26 KB
/
setup.py.bak
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
92
93
#-*- coding: utf8 -*-
import os
import sys
import setuptools
import warnings
from setuptools import setup
#
# Read VERSION from file and write it in the appropriate places
#
AUTHOR = 'Fábio Macêdo Mendes'
BASE, _ = os.path.split(__file__)
with open(os.path.join(BASE, 'VERSION')) as F:
VERSION = F.read().strip()
with open(os.path.join(BASE, 'src', 'FGAme', 'meta.py'), 'w') as F:
F.write(
'# Auto-generated file. Please do not edit\n'
'__version__ = %r\n' % VERSION +
'__author__ = %r\n' % AUTHOR)
VERSION_BIG = VERSION.rpartition('.')[0]
IS_PYPY = 'PyPy' in sys.version
setup_kwds = {}
#
# Choose the default Python3 branch or the code converted by 3to2
#
PYSRC = 'src' if sys.version_info[0] == 3 else 'py2src'
#
# Cython stuff (for the future)
#
if 'PyPy' not in sys.version:
try:
from Cython.Build import cythonize
from Cython.Distutils import build_ext
except ImportError:
warnings.warn('Please install Cython to compile faster versions of FGAme modules')
else:
try:
setup_kwds.update(
ext_modules=cythonize('src/generic/*.pyx'),
cmdclass={'build_ext': build_ext})
except ValueError:
pass
#
# Configure backend
#
try:
import pygame
BACKEND = ''
except ImportError:
BACKEND = 'pysdl2>=0.5'
#
# Main configuration script
#
setup(
name='FGAme',
version=VERSION,
description='A game engine for 2D physics',
author='Fábio Macêdo Mendes',
author_email='[email protected]',
url='https://github.com/fabiommendes/FGAme',
long_description=open(os.path.join(BASE, 'README.txt')).read(),
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries',
],
package_dir={'': PYSRC},
packages=setuptools.find_packages(PYSRC),
license='GPL',
install_requires='''
# cython>=0.21
%s
pillow
six
smallshapes
smallvectors
pygeneric
colortools
''' % BACKEND,
zip_safe=False,
**setup_kwds
)