-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathsetup.py
More file actions
104 lines (98 loc) · 2.69 KB
/
setup.py
File metadata and controls
104 lines (98 loc) · 2.69 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import os
import sys
import numpy as np
from Cython.Build import cythonize
from setuptools import Extension, find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
if sys.platform == "win32":
allocator_libs = [] # type: ignore
extra_compile_args = ["/openmp", "/O2"]
extra_link_args = ["/openmp"]
elif sys.platform == "darwin":
allocator_libs = ["jemalloc"]
extra_compile_args = [
"-Xpreprocessor",
"-fopenmp",
"-O3",
"--std=c++17",
]
extra_link_args = ["-lomp"]
else:
allocator_libs = ["jemalloc"]
extra_compile_args = [
"-fopenmp",
"-O3",
"--std=c++17",
]
extra_link_args = ["-fopenmp"]
extension_args = dict(
include_dirs=[np.get_include()],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
language="c++",
)
ext_modules = [
Extension(
name="glum._functions",
sources=["src/glum/_functions.pyx"],
**extension_args,
),
Extension(
name="glum._cd_fast",
sources=["src/glum/_cd_fast.pyx"],
**extension_args,
),
]
setup(
name="glum",
use_scm_version={"version_scheme": "post-release"},
description="High performance Python GLMs with all the features!",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Quantco/glum",
author="QuantCo, Inc.",
author_email="noreply@quantco.com",
license="BSD",
classifiers=[ # Optional
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
package_dir={"": "src"},
packages=find_packages(where="src", include=["glum"]),
python_requires=">=3.10",
install_requires=[
"formulaic>=1.2.0",
"joblib",
"narwhals>=2.0.0",
"numexpr",
"numpy>=1.24",
"packaging",
"pandas>=1.4",
"pyarrow",
"scikit-learn>=1.1.0",
"scipy>=1.8.0",
"tabmat>=4.1.5",
"tqdm",
],
entry_points=None,
ext_modules=cythonize(
ext_modules,
annotate=False,
compiler_directives={
"language_level": "3",
"boundscheck": False,
"wraparound": False,
"initializedcheck": False,
"nonecheck": False,
"cdivision": True,
"cpow": True,
"legacy_implicit_noexcept": True,
},
),
zip_safe=False,
)