forked from robhagemans/pcbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·124 lines (95 loc) · 3.47 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env python2
"""
PC-BASIC setup module.
(c) 2015, 2016 Rob Hagemans
This file is released under the GNU GPL version 3 or later.
"""
###############################################################################
# get descriptions and version number
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'docsrc', 'description.txt'), encoding='utf-8') as f:
long_description = f.read()
with open(path.join(here, 'docsrc', 'tagline.txt'), encoding='utf-8') as f:
description = f.read()
import pcbasic
version_string = pcbasic.__version__
###############################################################################
# implement build_docs command
# see http://seasonofcode.com/posts/how-to-add-custom-build-steps-and-commands-to-setup-py.html
import distutils.cmd
import setuptools.command.build_py
import docsrc.prepare
class BuildDocCommand(distutils.cmd.Command):
""" Command to build the documentation."""
description = 'build documentation files'
user_options = []
def run(self):
""" Run build_docs command. """
docsrc.prepare.build_docs()
def initialize_options(self):
""" Set default values for options. """
pass
def finalize_options(self):
""" Post-process options. """
pass
class BuildPyCommand(setuptools.command.build_py.build_py):
""" Custom build command. """
def run(self):
""" Run build_py command. """
self.run_command('build_docs')
setuptools.command.build_py.build_py.run(self)
###############################################################################
# metadata
# see https://github.com/pypa/sampleproject
from setuptools import setup, find_packages
setup(
name='pcbasic',
version=version_string,
description=description,
long_description=long_description,
url='http://pc-basic.org',
author='Rob Hagemans',
author_email='robhagemans@yahoo.co.uk',
license='GPLv3',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'Topic :: System :: Emulators',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 2.7',
],
keywords='emulator interpreter basic retro legacy gwbasic basica pcjr tandy basicode',
packages=find_packages(exclude=['doc', 'test', 'docsrc', 'packaging', 'patches']),
# List run-time dependencies here. These will be installed by pip when
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['sdl2', 'numpy', 'pyserial', 'pexpect'],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
# $ pip install -e .[dev,test]
#extras_require={
# 'dev': ['check-manifest'],
# 'test': ['coverage'],
#},
package_data={
'pcbasic': ['data/*', 'codepage/*',
'font/*'],
},
entry_points={
'console_scripts': [
'pcbasic=pcbasic.__main__:main',
],
'gui_scripts': [
'pcbasic=pcbasic.__main__:main',
],
},
cmdclass={
'build_docs': BuildDocCommand,
'build_py': BuildPyCommand,
},
)