-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathsetup.py
67 lines (58 loc) · 2.12 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
import setuptools
from setuptools import setup, Extension, find_packages
from setuptools.command.build_py import build_py
import subprocess
from pathlib import Path
import os
def custom_command():
subprocess.check_call(['make', '-C', 'musiclang_predict/c/'])
class CustomInstallBuildPy(build_py):
"""Custom build command that runs a Makefile."""
def run(self):
print('is called install')
custom_command()
# Call the superclass methods to handle Python extension building, if any
build_py.run(self)
module = Extension('musiclang_predict.c',
sources=['musiclang_predict/c/run.c'],
include_dirs=[],
extra_compile_args=['-Ofast', '-fPIC', '-shared'])
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text(encoding='utf-8')
setuptools.setup(
name="musiclang-predict",
version="1.2.0",
author="Florian GARDIN",
author_email="[email protected]",
description=("Controllable symbolic music generation with generative AI"
),
cmdclass={
'build_py': CustomInstallBuildPy,
},
#ext_modules=[module],
long_description=long_description,
long_description_content_type="text/markdown",
project_urls={
'Documentation': 'https://github.com/MusicLang/musiclang_predict',
'Source': 'https://github.com/MusicLang/musiclang_predict',
'Tracker': 'https://github.com/MusicLang/musiclang_predict/issues',
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
],
install_requires=[
"musiclang>=0.25",
"torch",
"transformers",
"tokenizers",
"torchtoolkit",
"accelerate"
],
packages=setuptools.find_packages(include='*'),
package_data={'musiclang_predict': ['c/*.h', 'c/*.c', 'c/*.so', 'c/*.dll', 'c/Makefile', 'corpus/*.mid'],
},
include_package_data=True,
python_requires=">=3.6",
)