Spaces:
Running
Running
Update setup.py
Browse files
setup.py
CHANGED
@@ -1,157 +1,8 @@
|
|
1 |
-
#!/usr/bin/env python
|
2 |
-
# -*- encoding: utf-8 -*-
|
3 |
-
# python3 setup.py sdist bdist_wheel
|
4 |
-
"""
|
5 |
-
@File : setup.py
|
6 |
-
@Contact : deepanwayedu@gmail.com
|
7 |
-
@License : (C)Copyright 2023-2100
|
8 |
-
"""
|
9 |
-
|
10 |
-
# !/usr/bin/env python
|
11 |
-
# -*- coding: utf-8 -*-
|
12 |
-
|
13 |
-
# Note: To use the 'upload' functionality of this file, you must:
|
14 |
-
# $ pipenv install twine --dev
|
15 |
-
|
16 |
-
import io
|
17 |
import os
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
DESCRIPTION = "This package is written for text-to-audio generation with TANGO."
|
26 |
-
URL = "https://github.com/declare-lab/tango"
|
27 |
-
EMAIL = "deepanwayedu@gmail.com"
|
28 |
-
AUTHOR = "Deepanway Ghosal"
|
29 |
-
REQUIRES_PYTHON = ">=3.7.0"
|
30 |
-
VERSION = "0.1.1"
|
31 |
-
|
32 |
-
# What packages are required for this module to be executed?
|
33 |
-
REQUIRED = [
|
34 |
-
"torch==1.13.1",
|
35 |
-
"torchaudio==0.13.1",
|
36 |
-
"torchvision==0.14.1",
|
37 |
-
"transformers==4.27.0",
|
38 |
-
"einops==0.6.1",
|
39 |
-
"h5py==3.8.0",
|
40 |
-
"huggingface_hub==0.13.3",
|
41 |
-
"importlib_metadata==6.3.0",
|
42 |
-
"librosa==0.9.2",
|
43 |
-
"numpy==1.23.0",
|
44 |
-
"omegaconf==2.3.0",
|
45 |
-
"packaging==23.1",
|
46 |
-
"pandas==1.4.1",
|
47 |
-
"progressbar33==2.4",
|
48 |
-
"protobuf==3.20.*",
|
49 |
-
"resampy==0.4.2",
|
50 |
-
"scikit_image==0.19.3",
|
51 |
-
"scikit_learn==1.2.2",
|
52 |
-
"scipy==1.8.0",
|
53 |
-
"soundfile==0.12.1",
|
54 |
-
"ssr_eval==0.0.6",
|
55 |
-
"torchlibrosa==0.1.0",
|
56 |
-
"tqdm==4.63.1",
|
57 |
-
"wandb==0.12.14",
|
58 |
-
"ipython==8.12.0"
|
59 |
-
]
|
60 |
-
|
61 |
-
# What packages are optional?
|
62 |
-
EXTRAS = {}
|
63 |
-
|
64 |
-
# The rest you shouldn't have to touch too much :)
|
65 |
-
# ------------------------------------------------
|
66 |
-
# Except, perhaps the License and Trove Classifiers!
|
67 |
-
# If you do change the License, remember to change the Trove Classifier for that!
|
68 |
-
|
69 |
-
here = os.path.abspath(os.path.dirname(__file__))
|
70 |
-
|
71 |
-
# Import the README and use it as the long-description.
|
72 |
-
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
|
73 |
-
try:
|
74 |
-
with io.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
|
75 |
-
long_description = "\n" + f.read()
|
76 |
-
except FileNotFoundError:
|
77 |
-
long_description = DESCRIPTION
|
78 |
-
|
79 |
-
# Load the package's __version__.py module as a dictionary.
|
80 |
-
about = {}
|
81 |
-
if not VERSION:
|
82 |
-
project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
|
83 |
-
with open(os.path.join(here, project_slug, "__version__.py")) as f:
|
84 |
-
exec(f.read(), about)
|
85 |
-
else:
|
86 |
-
about["__version__"] = VERSION
|
87 |
-
|
88 |
-
|
89 |
-
class UploadCommand(Command):
|
90 |
-
"""Support setup.py upload."""
|
91 |
-
|
92 |
-
description = "Build and publish the package."
|
93 |
-
user_options = []
|
94 |
-
|
95 |
-
@staticmethod
|
96 |
-
def status(s):
|
97 |
-
"""Prints things in bold."""
|
98 |
-
print("\033[1m{0}\033[0m".format(s))
|
99 |
-
|
100 |
-
def initialize_options(self):
|
101 |
-
pass
|
102 |
-
|
103 |
-
def finalize_options(self):
|
104 |
-
pass
|
105 |
-
|
106 |
-
def run(self):
|
107 |
-
try:
|
108 |
-
self.status("Removing previous builds…")
|
109 |
-
rmtree(os.path.join(here, "dist"))
|
110 |
-
except OSError:
|
111 |
-
pass
|
112 |
-
|
113 |
-
self.status("Building Source and Wheel (universal) distribution…")
|
114 |
-
os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))
|
115 |
-
|
116 |
-
self.status("Uploading the package to PyPI via Twine…")
|
117 |
-
os.system("twine upload dist/*")
|
118 |
-
|
119 |
-
self.status("Pushing git tags…")
|
120 |
-
os.system("git tag v{0}".format(about["__version__"]))
|
121 |
-
os.system("git push --tags")
|
122 |
-
|
123 |
-
sys.exit()
|
124 |
-
|
125 |
-
|
126 |
-
# Where the magic happens:
|
127 |
-
setup(
|
128 |
-
name=NAME,
|
129 |
-
version=about["__version__"],
|
130 |
-
description=DESCRIPTION,
|
131 |
-
long_description=long_description,
|
132 |
-
long_description_content_type="text/markdown",
|
133 |
-
author=AUTHOR,
|
134 |
-
author_email=EMAIL,
|
135 |
-
python_requires=REQUIRES_PYTHON,
|
136 |
-
url=URL,
|
137 |
-
install_requires=REQUIRED,
|
138 |
-
extras_require=EXTRAS,
|
139 |
-
packages=find_packages(),
|
140 |
-
include_package_data=True,
|
141 |
-
license="MIT",
|
142 |
-
classifiers=[
|
143 |
-
# Trove classifiers
|
144 |
-
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
145 |
-
"License :: OSI Approved :: MIT License",
|
146 |
-
"Programming Language :: Python",
|
147 |
-
"Programming Language :: Python :: 3",
|
148 |
-
"Programming Language :: Python :: 3.7",
|
149 |
-
"Programming Language :: Python :: Implementation :: CPython",
|
150 |
-
"Programming Language :: Python :: Implementation :: PyPy",
|
151 |
-
],
|
152 |
-
# $ setup.py publish support.
|
153 |
-
cmdclass={
|
154 |
-
"upload": UploadCommand,
|
155 |
-
},
|
156 |
-
scripts=["bin/tango.cmd", "bin/tango"],
|
157 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
+
lib_folder = os.path.dirname(os.path.realpath(__file__))
|
3 |
+
requirement_path = "requirements.txt"
|
4 |
+
install_requires = []
|
5 |
+
if os.path.isfile(requirement_path):
|
6 |
+
with open(requirement_path) as f:
|
7 |
+
install_requires = f.read().splitlines()
|
8 |
+
setup(name="mypackage", install_requires=install_requires, [...])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|