Skip to content

Commit

Permalink
Merge pull request #1484 from Jackwaterveg/r0.1_develop
Browse files Browse the repository at this point in the history
[Setup] make librosa version fixed
  • Loading branch information
zh794390558 authored Feb 24, 2022
2 parents 3d5aac6 + b222e29 commit c7a9650
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 52 deletions.
2 changes: 0 additions & 2 deletions paddlespeech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
48 changes: 0 additions & 48 deletions requirements.txt

This file was deleted.

28 changes: 26 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

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

VERSION = '0.1.2'

requirements = {
"install": [
"editdistance",
Expand All @@ -37,7 +39,7 @@
"jieba",
"jsonlines",
"kaldiio",
"librosa",
"librosa==0.8.1",
"loguru",
"matplotlib",
"nara_wpe",
Expand Down Expand Up @@ -82,6 +84,24 @@
}


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()
Expand Down Expand Up @@ -169,10 +189,12 @@ def run(self):
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='[email protected]',
url='https://github.com/PaddlePaddle/PaddleSpeech',
Expand Down Expand Up @@ -235,3 +257,5 @@ def run(self):
})

setup(**setup_info)

remove_version_py()

0 comments on commit c7a9650

Please sign in to comment.