From b222e2980bf0a40266a031b0169dc9230868ed14 Mon Sep 17 00:00:00 2001 From: huangyuxin Date: Thu, 24 Feb 2022 11:25:45 +0000 Subject: [PATCH] make librosa version fixed --- paddlespeech/__init__.py | 2 -- requirements.txt | 48 ---------------------------------------- setup.py | 28 +++++++++++++++++++++-- 3 files changed, 26 insertions(+), 52 deletions(-) delete mode 100644 requirements.txt diff --git a/paddlespeech/__init__.py b/paddlespeech/__init__.py index 8d32f287..185a92b8 100644 --- a/paddlespeech/__init__.py +++ b/paddlespeech/__init__.py @@ -11,5 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -__version__ = '0.1.0' diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 76082166..00000000 --- a/requirements.txt +++ /dev/null @@ -1,48 +0,0 @@ -ConfigArgParse -coverage -editdistance -g2p_en -g2pM -gpustat -h5py -inflect -jieba -jsonlines -kaldiio -librosa -loguru -matplotlib -nara_wpe -nltk -paddleaudio -paddlenlp -paddlespeech_ctcdecoders -paddlespeech_feat -pandas -phkit -Pillow -praatio==5.0.0 -pre-commit -pybind11 -pypi-kenlm -pypinyin -python-dateutil -pyworld -resampy==0.2.2 -sacrebleu -scipy -sentencepiece~=0.1.96 -snakeviz -soundfile~=0.10 -sox -soxbindings -textgrid -timer -tqdm -typeguard -unidecode -visualdl -webrtcvad -yacs~=0.1.8 -yq -zhon diff --git a/setup.py b/setup.py index a6b18f97..97ecb874 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,8 @@ from setuptools.command.install import install HERE = Path(os.path.abspath(os.path.dirname(__file__))) +VERSION = '0.1.2' + requirements = { "install": [ "editdistance", @@ -37,7 +39,7 @@ requirements = { "jieba", "jsonlines", "kaldiio", - "librosa", + "librosa==0.8.1", "loguru", "matplotlib", "nara_wpe", @@ -82,6 +84,24 @@ requirements = { } +def write_version_py(filename='paddlespeech/__init__.py'): + import paddlespeech + if hasattr(paddlespeech, + "__version__") and paddlespeech.__version__ == VERSION: + return + with open(filename, "a") as f: + f.write(f"\n__version__ = '{VERSION}'\n") + + +def remove_version_py(filename='paddlespeech/__init__.py'): + with open(filename, "r") as f: + lines = f.readlines() + with open(filename, "w") as f: + for line in lines: + if "__version__" not in line: + f.write(line) + + @contextlib.contextmanager def pushd(new_dir): old_dir = os.getcwd() @@ -169,10 +189,12 @@ class UploadCommand(Command): sys.exit() +write_version_py() + setup_info = dict( # Metadata name='paddlespeech', - version='0.1.1', + version=VERSION, author='PaddlePaddle Speech and Language Team', author_email='paddlesl@baidu.com', url='https://github.com/PaddlePaddle/PaddleSpeech', @@ -235,3 +257,5 @@ setup_info = dict( }) setup(**setup_info) + +remove_version_py()