-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
71 lines (58 loc) · 1.93 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
from os import path
import platform
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
from setuptools.extension import Extension
ENABLE_LINETRACE = "test" in sys.argv and platform.python_implementation() == "CPython"
try:
from Cython.Build import cythonize
from Cython.Distutils import build_ext
ext_modules = cythonize(
Extension(
"archi",
["archi.pyx"],
libraries=["archive"],
define_macros=[("CYTHON_TRACE", ENABLE_LINETRACE and "1" or "0")],
),
gdb_debug=True,
compiler_directives={
"linetrace": ENABLE_LINETRACE,
"binding": ENABLE_LINETRACE,
},
)
except ImportError:
ext_modules = [Extension("archi", ["archi.c"], libraries=["archive"],)]
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
class PyTest(TestCommand):
def run_tests(self):
import pytest
errno = pytest.main(
["--cov", "--cov-report", "xml", "--cov-report", "term-missing"]
)
sys.exit(errno)
setup(
name="archi",
version="0.2.3",
description="Multi-format archive library based on libarchive",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
zip_safe=False,
include_package_data=True,
keywords=["libarchive", "archive", "compress", "compression"],
author="Wu Haotian",
author_email="[email protected]",
url="https://github.com/whtsky/archi",
classifiers=[
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Libraries",
],
cmdclass={"test": PyTest},
ext_modules=ext_modules,
)