Skip to content

Commit 989aec4

Browse files
committed
optimize the setup.py and setup.sh
1 parent 1d7ce0e commit 989aec4

File tree

6 files changed

+75
-20
lines changed

6 files changed

+75
-20
lines changed

docs/source/install.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,33 @@ To avoid the trouble of environment setup, [running in Docker container](#runnin
1010

1111
For user who working on `Ubuntu` with `root` privilege.
1212

13-
```python
13+
```bash
1414
git clone https://github.com/PaddlePaddle/DeepSpeech.git
15-
cd DeepSpeech
16-
pip install -e .
15+
cd PaddleSpeech
16+
```
17+
18+
If you want to use the basic function of the repo, you can use:
19+
```bash
20+
pip install .
21+
```
22+
23+
If you want to do the development, you can use:
24+
```
25+
pip install -e .[develop]
1726
```
1827

1928
For user who only needs the basic function of paddlespeech, using conda to do installing is recommended.
2029
You can go to [minicoda](https://docs.conda.io/en/latest/miniconda.html) to select a version and install it by yourself, or you can use the scripts below to install the last miniconda version.
2130

22-
```python
31+
```bash
2332
pushd tools
2433
bash extras/install_miniconda.sh
2534
popd
2635
bash
2736
```
2837

2938
After installing the conda, run the setup.sh to complete the installing process.
30-
```python
39+
```bash
3140
bash setup.sh
3241
```
3342

requirements.txt

-6
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
ConfigArgParse
22
coverage
3-
distro
43
editdistance
54
g2p_en
65
g2pM
76
gpustat
8-
GPUtil
97
h5py
108
inflect
119
jieba
1210
jsonlines
1311
kaldiio
1412
librosa
15-
llvmlite
1613
loguru
1714
matplotlib
1815
nara_wpe
1916
nltk
20-
numba
2117
paddlespeech_ctcdecoders
2218
paddlespeech_feat
2319
pandas
2420
phkit
2521
Pillow
2622
praatio~=4.1
2723
pre-commit
28-
psutil
2924
pybind11
30-
pynvml
3125
pypi-kenlm
3226
pypinyin
3327
python-dateutil

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ description-file = README.md
77

88
[magformat]
99
formatters=yapf
10+
11+
[easy_install]
12+
index-url=https://pypi.tuna.tsinghua.edu.cn/simple

setup.py

+56-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,58 @@
2727

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

30+
requirements = {
31+
"install": [
32+
"editdistance",
33+
"g2p_en",
34+
"g2pM",
35+
"h5py",
36+
"inflect",
37+
"jieba",
38+
"jsonlines",
39+
"kaldiio",
40+
"librosa",
41+
"loguru",
42+
"matplotlib",
43+
"nara_wpe",
44+
"nltk",
45+
"pandas",
46+
"paddlespeech_ctcdecoders",
47+
"paddlespeech_feat",
48+
"praatio~=4.1",
49+
"pypi-kenlm",
50+
"pypinyin",
51+
"python-dateutil",
52+
"pyworld",
53+
"resampy==0.2.2",
54+
"sacrebleu",
55+
"scipy",
56+
"sentencepiece~=0.1.96",
57+
"soundfile~=0.10",
58+
"sox",
59+
"soxbindings",
60+
"textgrid",
61+
"timer",
62+
"tqdm",
63+
"typeguard",
64+
"visualdl",
65+
"webrtcvad",
66+
"yacs",
67+
],
68+
"develop": [
69+
"ConfigArgParse",
70+
"coverage",
71+
"gpustat",
72+
"phkit",
73+
"Pillow",
74+
"pybind11",
75+
"snakeviz",
76+
"unidecode",
77+
"yq",
78+
"pre-commit",
79+
]
80+
}
81+
3082

3183
@contextlib.contextmanager
3284
def pushd(new_dir):
@@ -130,7 +182,7 @@ def run(self):
130182
setup_info = dict(
131183
# Metadata
132184
name='paddlespeech',
133-
version='0.0.1a',
185+
version='0.1.0a',
134186
author='PaddlePaddle Speech and Language Team',
135187
author_email='[email protected]',
136188
url='https://github.com/PaddlePaddle/PaddleSpeech',
@@ -158,8 +210,10 @@ def run(self):
158210
"gan",
159211
],
160212
python_requires='>=3.6',
161-
install_requires=[d.strip() for d in read('requirements.txt').split()],
213+
install_requires=requirements["install"],
162214
extras_require={
215+
'develop':
216+
requirements["develop"],
163217
'doc': [
164218
"sphinx", "sphinx-rtd-theme", "numpydoc", "myst_parser",
165219
"recommonmark>=0.5.0", "sphinx-markdown-tables", "sphinx-autobuild"

setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
conda install -c conda-forge sox libsndfile swig bzip2 bottleneck gcc_linux-64=8.4.0 gxx_linux-64=8.4.0 --yes
33

44
# Install the python lib
5-
pip install -r requirements.txt
5+
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
66

77
# Install the auto_log
88
pushd tools/extras

tools/Makefile

+1-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ WGET ?= wget --no-check-certificate
1010

1111
.PHONY: all clean
1212

13-
all: virtualenv.done apt.done kenlm.done sox.done soxbindings.done mfa.done sclite.done
13+
all: virtualenv.done apt.done kenlm.done sox.done mfa.done sclite.done
1414

1515
virtualenv.done:
1616
test -d venv || virtualenv -p $(PYTHON) venv
@@ -45,11 +45,6 @@ sox.done:
4545
cd sox-14.4.2 && ./configure --prefix=/usr/ && make -j4 && make install
4646
touch sox.done
4747

48-
soxbindings.done:
49-
test -d soxbindings || git clone https://github.com/pseeth/soxbindings.git
50-
cd soxbindings && python setup.py install
51-
touch soxbindings.done
52-
5348
mfa.done:
5449
test -d montreal-forced-aligner || $(WGET) https://paddlespeech.bj.bcebos.com/Parakeet/montreal-forced-aligner_linux.tar.gz
5550
tar xvf montreal-forced-aligner_linux.tar.gz

0 commit comments

Comments
 (0)