Skip to content

Commit 4c99fea

Browse files
authored
Merge pull request #24 from jsingh811/python-package-yml
Python version checks
2 parents 9177675 + 5043a1e commit 4c99fea

File tree

4 files changed

+64
-5
lines changed

4 files changed

+64
-5
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.6, 3.7, 3.8, 3.9]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install flake8 pytest
30+
pip install -r requirements/requirements.txt
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Test with pytest
38+
run: |
39+
pytest

pyAudioProcessing/features/audioFeatureExtraction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def dirWavFeatureExtraction(dirName, mt_win, mt_step, st_win, st_step, feats,
202202
if isinstance(x, int):
203203
continue
204204

205-
t1 = time.clock()
205+
t1 = time.time()
206206
x = audioBasicIO.stereo2mono(x)
207207
if x.shape[0]<float(fs)/5:
208208
print(" (AUDIO FILE TOO SMALL - SKIPPING)")
@@ -233,7 +233,7 @@ def dirWavFeatureExtraction(dirName, mt_win, mt_step, st_win, st_step, feats,
233233
all_mt_feats = mt_term_feats
234234
else:
235235
all_mt_feats = numpy.vstack((all_mt_feats, mt_term_feats))
236-
t2 = time.clock()
236+
t2 = time.time()
237237
duration = float(len(x)) / fs
238238
process_times.append((t2 - t1) / duration)
239239
if len(process_times) > 0:

requirements/requirements.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
numpy==1.16.4
1+
numpy==1.19.5
22
matplotlib==3.1.2
3-
scipy==1.3.0
4-
scikit-learn==0.21.2
3+
scipy==1.5.4
4+
scikit-learn==0.24.2
55
simplejson==3.16.0
66
eyed3==0.9.5
77
pydub==0.23.1
88
pyAudioAnalysis==0.2.5
9+
pytest==6.2.3
10+
rsa==3.4.2
11+
bleach==3.3.0
12+
docutils==0.17.1
13+
Pygments==2.8.1
14+
jmespath==0.9.5
15+
urllib3==1.26.4
16+
colorama==0.4.3
17+
PyYAML==5.3
18+
requests==2.25.1
19+
tqdm==4.60.0
20+
pkginfo==1.7.0
21+
keyring==23.0.1

tests/test_classification.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import pytest
2+
3+
def test_classifications():
4+
"""
5+
"""
6+
# TODO
7+
assert True

0 commit comments

Comments
 (0)