-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
53 lines (44 loc) · 1.45 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
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
try:
from setuptools_rust import RustExtension
except ImportError:
import subprocess
errno = subprocess.call([sys.executable, '-m', 'pip', 'install', 'setuptools-rust'])
if errno:
print("Please install setuptools-rust package")
raise SystemExit(errno)
else:
from setuptools_rust import RustExtension
class PyTest(TestCommand):
user_options = []
def run(self):
self.run_command("test_rust")
import subprocess
import sys
errno = subprocess.call([sys.executable, '-m', 'pytest', 'tests'])
raise SystemExit(errno)
setup_requires = ['setuptools-rust>=0.10.3']
install_requires = []
tests_require = install_requires + ['ciso8601', 'pytest', 'pytest-benchmark[histogram]']
setup(
name='dtparse',
version='1.3.2',
classifiers=[
'License :: OSI Approved :: MIT License',
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Rust',
],
packages=['dtparse'],
rust_extensions=[RustExtension('dtparse._dtparse', 'Cargo.toml')],
install_requires=install_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
setup_requires=setup_requires,
include_package_data=True,
zip_safe=False,
cmdclass=dict(test=PyTest)
)