-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
72 lines (64 loc) · 2.44 KB
/
setup.py
File metadata and controls
72 lines (64 loc) · 2.44 KB
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
72
import os
from setuptools import Extension, find_packages, setup
LAZYCSV_DEBUG = int("LAZYCSV_DEBUG" in os.environ)
LAZYCSV_INDEX_DTYPE = os.environ.get("LAZYCSV_INDEX_DTYPE", "uint16_t")
LAZYCSV_INCLUDE_NUMPY = int("LAZYCSV_INCLUDE_NUMPY" in os.environ)
LAZYCSV_INCLUDE_NUMPY_LEGACY = int("LAZYCSV_INCLUDE_NUMPY_LEGACY" in os.environ)
include_dirs = (
[__import__("numpy").get_include()]
if (LAZYCSV_INCLUDE_NUMPY | LAZYCSV_INCLUDE_NUMPY_LEGACY)
else []
)
if not LAZYCSV_INDEX_DTYPE.startswith(("unsigned", "uint")):
raise ValueError("specified LAZYCSV_INDEX_DTYPE must be an unsigned integer type")
extensions = [
Extension(
"lazycsv.lazycsv",
[os.path.join("src", "lazycsv", "lazycsv.c")],
include_dirs=include_dirs,
define_macros=[
("INDEX_DTYPE", LAZYCSV_INDEX_DTYPE),
("INCLUDE_NUMPY", LAZYCSV_INCLUDE_NUMPY),
("INCLUDE_NUMPY_LEGACY", LAZYCSV_INCLUDE_NUMPY_LEGACY),
("DEBUG", LAZYCSV_DEBUG),
],
)
]
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setup(
name="lazycsv",
version="1.1.7",
author="Michael Green, Chris Perkins",
author_email="dev@crunch.io",
description="an fast, memory efficient csv parser",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(where="src"),
extras_require={
"test": ["pytest", "numpy"],
"benchmark": ["datatable", "pandas", "pyarrow", "polars"],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Utilities",
],
package_dir={"": "src"},
ext_modules=extensions,
)