Skip to content

Commit b222e29

Browse files
committed
make librosa version fixed
1 parent 3d5aac6 commit b222e29

File tree

3 files changed

+26
-52
lines changed

3 files changed

+26
-52
lines changed

paddlespeech/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
__version__ = '0.1.0'

requirements.txt

Lines changed: 0 additions & 48 deletions
This file was deleted.

setup.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
HERE = Path(os.path.abspath(os.path.dirname(__file__)))
2929

30+
VERSION = '0.1.2'
31+
3032
requirements = {
3133
"install": [
3234
"editdistance",
@@ -37,7 +39,7 @@
3739
"jieba",
3840
"jsonlines",
3941
"kaldiio",
40-
"librosa",
42+
"librosa==0.8.1",
4143
"loguru",
4244
"matplotlib",
4345
"nara_wpe",
@@ -82,6 +84,24 @@
8284
}
8385

8486

87+
def write_version_py(filename='paddlespeech/__init__.py'):
88+
import paddlespeech
89+
if hasattr(paddlespeech,
90+
"__version__") and paddlespeech.__version__ == VERSION:
91+
return
92+
with open(filename, "a") as f:
93+
f.write(f"\n__version__ = '{VERSION}'\n")
94+
95+
96+
def remove_version_py(filename='paddlespeech/__init__.py'):
97+
with open(filename, "r") as f:
98+
lines = f.readlines()
99+
with open(filename, "w") as f:
100+
for line in lines:
101+
if "__version__" not in line:
102+
f.write(line)
103+
104+
85105
@contextlib.contextmanager
86106
def pushd(new_dir):
87107
old_dir = os.getcwd()
@@ -169,10 +189,12 @@ def run(self):
169189
sys.exit()
170190

171191

192+
write_version_py()
193+
172194
setup_info = dict(
173195
# Metadata
174196
name='paddlespeech',
175-
version='0.1.1',
197+
version=VERSION,
176198
author='PaddlePaddle Speech and Language Team',
177199
author_email='[email protected]',
178200
url='https://github.com/PaddlePaddle/PaddleSpeech',
@@ -235,3 +257,5 @@ def run(self):
235257
})
236258

237259
setup(**setup_info)
260+
261+
remove_version_py()

0 commit comments

Comments
 (0)