Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
46 lines (40 loc) · 1.27 KB
/
Copy pathsetup.py
File metadata and controls
46 lines (40 loc) · 1.27 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
importtypingastp
fromsetuptoolsimportsetup, Extension
fromsetuptools.command.build_extimportbuild_ext
importsite, os
frompathlibimportPath
AK_VERSION=Path('VERSION').read_text(encoding='utf-8').strip()
defget_ext_dir(*components: tp.Iterable[str]) ->tp.Sequence[str]:
dirs= []
# Check user site-packages
user_site=site.getusersitepackages()
ifuser_site:
fp=os.path.join(user_site, *components)
ifos.path.exists(fp):
dirs.append(fp)
# Check system site-packages
forspinsite.getsitepackages():
fp=os.path.join(sp, *components)
ifos.path.exists(fp):
dirs.append(fp)
returndirs
ext_modules= [
Extension(
name='arraykit._arraykit',
sources=[
'src/_arraykit.c',
'src/array_go.c',
'src/array_to_tuple.c',
'src/block_index.c',
'src/delimited_to_arrays.c',
'src/methods.c',
'src/tri_map.c',
'src/auto_map.c',
],
include_dirs=get_ext_dir('numpy', '_core', 'include') + ['src'],
library_dirs=get_ext_dir('numpy', '_core', 'lib'),
define_macros=[('AK_VERSION', AK_VERSION)],
libraries=['npymath'],
)
]
setup(ext_modules=ext_modules)