-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathsetup.py
65 lines (56 loc) · 2.12 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
'''
Copyright (C) 2020-2021 Bryant Moscon - [email protected]
Please see the LICENSE file for the terms and conditions
associated with this software.
'''
import glob
import os
from os import path
from setuptools import setup, Extension, find_packages
from setuptools.command.test import test as TestCommand
import sys
sources = glob.glob('orderbook/*.c')
optimize_arg = "/O2" if os.name == "nt" else "-O3"
orderbook = Extension('order_book', sources=sources, extra_compile_args=[optimize_arg])
def get_long_description():
repo_dir = path.abspath(path.dirname(__file__))
markdown = []
for filename in ("README.md", "CHANGES.md"):
with open(path.join(repo_dir, filename), encoding="utf-8") as markdown_file:
markdown.append(markdown_file.read())
return "\n\n----\n\n".join(markdown)
class Test(TestCommand):
def run_tests(self):
import pytest
errno = pytest.main(['tests/'])
sys.exit(errno)
setup(
name='order_book',
version='0.4.2',
author="Bryant Moscon",
author_email="[email protected]",
description="A fast orderbook implementation, in C, for Python",
long_description=get_long_description(),
long_description_content_type="text/markdown",
keywords=["market data", "trading"],
url="https://github.com/bmoscon/orderbook",
ext_modules=[orderbook],
packages=find_packages(exclude=['tests*']),
license='License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
tests_require=["pytest", "requests", "sortedcontainers"],
cmdclass={'test': Test},
classifiers=[
"Intended Audience :: Developers",
"Development Status :: 3 - Alpha",
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: POSIX"
],
)