-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup.py
More file actions
56 lines (48 loc) · 1.6 KB
/
setup.py
File metadata and controls
56 lines (48 loc) · 1.6 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
# Copyright (c) 2024-2025, Christian Gilli <[email protected]>
# All rights reserved.
#
# This code is licensed under the terms of the 3-clause BSD license
# (https://opensource.org/license/bsd-3-clause).
from setuptools import setup, find_packages
from setuptools.command.install import install
import subprocess
import os
from pathlib import Path
def _compile_cpp():
subprocess.check_call(
['make', 'shared', 'DSC_FAST=1'], cwd=os.path.dirname(os.path.abspath(__file__))
)
class BuildCmd(install):
def run(self):
_compile_cpp()
install.run(self)
if __name__ == '__main__':
with open(Path(__file__).parent / 'README.md', 'r', encoding='utf-8') as f:
long_description = f.read()
packages = find_packages('python')
package_dir = {'': 'python'}
package_data = {'dsc': ['*.so']}
setup(
name='dsc',
version='0.1',
author='Christian Gilli',
license='BSD-3-Clause',
description='DSPCraft tensor processing library.',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/dspcraft/dsc',
packages=packages,
package_dir=package_dir,
install_requires=[
'numpy',
'psutil',
],
extras_require={'dev': ['matplotlib', 'pytest', 'tabulate', 'pyright', 'ruff']},
cmdclass={
'install': BuildCmd,
},
include_package_data=True,
package_data=package_data,
python_requires='>=3.10',
)