-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
55 lines (50 loc) · 1.74 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
import pathlib
import setuptools
import setuptools.extension
import setuptools.command.build_ext
import sys
dirname = pathlib.Path(__file__).resolve().parent
with open(dirname / "README.md") as file:
long_description = file.read()
extra_compile_args = []
extra_link_args = []
if sys.platform == "linux":
extra_compile_args += ["-std=c++17"]
extra_link_args += ["-std=c++17", "-lstdc++"]
elif sys.platform == "darwin":
extra_compile_args += ["-std=c++17", "-stdlib=libc++"]
extra_link_args += ["-std=c++17", "-stdlib=libc++"]
exec(
open(dirname / "source" / "version.py").read()
) # import would fail because the extension is not built yet
setuptools.setup(
name="lzip",
version=__version__, # type: ignore
url="https://github.com/neuromorphicsystems/lzip",
author="Alexandre Marcireau",
author_email="alexandre.marcireau@gmail.com",
description="Lzip (.lz) archives compression and decompression with buffers and URLs support",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
packages=["lzip"],
package_dir={"lzip": "source"},
ext_modules=[
setuptools.extension.Extension(
"lzip_extension",
language="cpp",
sources=[
str(dirname / "source" / "lzip_extension.cpp"),
str(dirname / "third_party" / "lzlib" / "lzlib.cpp"),
],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
include_dirs=[],
libraries=[],
),
],
)