This repository has been archived by the owner on Mar 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathsetup.py
106 lines (97 loc) · 3.5 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*- coding: utf-8 -*-
from setuptools import setup
from codecs import open
import platform
import errno
import sys
import os
import re
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass into py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
def mkdir_p(path):
#thanks http://stackoverflow.com/a/600612/965638
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
datafiles = dict(data_files=[])
osname = platform.system()
if osname == 'Linux':
linuxdist = platform.linux_distribution()[0]
if linuxdist == 'Ubuntu' or linuxdist =='Debian':
mkdir_p(os.path.expanduser('~/.local/share/applications'))
mkdir_p(os.path.expanduser('~/.local/share/icons'))
mkdir_p(os.path.expanduser('~/.local/share/mime'))
datafiles = dict(data_files=[('share/applications', ['platform/ubuntu/fgmk.desktop']),
('share/icons', ['platform/ubuntu/fgmk.svg',
'platform/ubuntu/fgmk-map.svg']),
('share/mime', ['platform/ubuntu/fgmk.xml'])])
with open('fgmk/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
test_requirements = ['pytest>=2.8.0']
if(int(sys.version_info.major) == 2):
install_requires = ['numpy','pillow']
print("!!!Please INSTALL PYQT5!!!")
else:
install_requires = ['numpy','pillow','pyqt5']
setup(
name='fgmk',
version=version,
description='A PyQt5 Maker to generate a RPG Javascript game.',
long_description=long_description,
url='https://github.com/ericoporto/fgmk',
download_url = 'https://github.com/ericoporto/fgmk/tarball/'+version,
author='Erico Vieira Porto',
author_email='ericoporto2008@gmail.com',
license='GPLv2',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Games/Entertainment :: Role-Playing',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5'
],
cmdclass={'test': PyTest},
tests_require=test_requirements,
keywords='game development',
install_requires=install_requires,
packages = ["fgmk","fgmk.ff","fgmk.util","fgmk.dock"],
entry_points={
'gui_scripts': [
'fgmk = fgmk.__main__:main'
]
},
package_data = {
'fgmk': ['data/*.png',
'data/actions/*.png',
'data/*.json',
'data/basegame.tar.gz',
'data/example.tar.gz',
'data/fgmk.qhc',
'data/fgmk.qch']
},
**datafiles
)