-
Notifications
You must be signed in to change notification settings - Fork 42
/
setup.py
67 lines (56 loc) · 1.89 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
#!/usr/bin/env python
# vi:ts=4:et
from __future__ import print_function
import os
import subprocess
import sys
from glob import glob
from setuptools import Command, Extension, setup
class TestCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
raise SystemExit(
subprocess.call([sys.executable,
"-m",
"pytest"]))
lzo_dir = os.environ.get("LZO_DIR", "lzo-2.10") # Relative path.
src_list = ["lzomodule.c"]
if sys.platform == "win32":
src_list += glob(os.path.join(lzo_dir, "src/*.c"))
setup(
name="python-lzo",
version="1.16",
description="Python bindings for the LZO data compression library",
author="Markus F.X.J. Oberhumer",
author_email="[email protected]",
maintainer="Joshua D. Boyd",
maintainer_email="[email protected]",
url="https://github.com/jd-boyd/python-lzo",
license="GNU General Public License (GPL)",
tests_require=['pytest'],
cmdclass={
"test": TestCommand
},
ext_modules=[
Extension(
name="lzo",
sources=src_list,
include_dirs=[os.path.join(lzo_dir, "include")],
libraries=['lzo2'] if not sys.platform == "win32" else [],
library_dirs=[os.path.join(lzo_dir, "lib")],
#extra_link_args=["-flat_namespace"] if sys.platform == "darwin" else [],
)
],
long_description="""
This module provides Python bindings for the LZO data compression library.
LZO is a portable lossless data compression library written in ANSI C.
It offers pretty fast compression and *very* fast decompression.
Decompression requires no memory.
In addition there are slower compression levels achieving a quite
competitive compression ratio while still decompressing at
this very high speed.""",
)