Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apPFeat/app test #12

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ jobs:
pip install ruff
ruff --format=github --target-version=py37 .
continue-on-error: true
- name: Print Current Working Directory
run: pwd
- name: List Directory Contents
run: ls -l
- name: Test with pytest
run: |
pip install pytest
pytest
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ ignore = ['E501']

[tool.pytest.ini_options]
pythonpath = [
"app",
"app", "."
]
testpaths = "tests"
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
streamlit==1.22.*
streamlit==1.28.1
demucs==4.0.0
pandas==1.5.3
pydub==0.25.1
Expand Down
130 changes: 64 additions & 66 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# pip-compile --output-file=requirements.txt requirements.in
#
altair==4.2.2
altair==5.1.2
# via streamlit
antlr4-python3-runtime==4.9.3
# via omegaconf
Expand All @@ -14,53 +14,51 @@ attrs==23.1.0
# via
# jsonschema
# referencing
audioread==3.0.0
audioread==3.0.1
# via librosa
blinker==1.6.2
blinker==1.7.0
# via streamlit
brotli==1.0.9
brotli==1.1.0
# via yt-dlp
cachetools==5.3.1
cachetools==5.3.2
# via streamlit
certifi==2023.5.7
certifi==2023.7.22
# via
# requests
# yt-dlp
cffi==1.15.1
cffi==1.16.0
# via soundfile
charset-normalizer==3.2.0
charset-normalizer==3.3.2
# via requests
click==8.1.5
click==8.1.7
# via streamlit
cloudpickle==2.2.1
cloudpickle==3.0.0
# via submitit
contourpy==1.1.0
contourpy==1.2.0
# via matplotlib
cycler==0.11.0
cycler==0.12.1
# via matplotlib
cython==0.29.36
cython==3.0.5
# via diffq
decorator==5.1.1
# via
# librosa
# validators
# via librosa
demucs==4.0.0
# via -r requirements.in
diffq==0.2.4
# via demucs
dora-search==0.1.12
# via demucs
einops==0.6.1
einops==0.7.0
# via demucs
entrypoints==0.4
# via altair
filelock==3.12.2
filelock==3.13.1
# via torch
fonttools==4.41.0
fonttools==4.44.0
# via matplotlib
gitdb==4.0.10
fsspec==2023.10.0
# via torch
gitdb==4.0.11
# via gitpython
gitpython==3.1.32
gitpython==3.1.40
# via streamlit
htbuilder==0.6.1
# via -r requirements.in
Expand All @@ -73,25 +71,25 @@ jinja2==3.1.2
# altair
# pydeck
# torch
joblib==1.3.1
joblib==1.3.2
# via
# librosa
# scikit-learn
jsonschema==4.18.3
jsonschema==4.19.2
# via altair
jsonschema-specifications==2023.6.1
jsonschema-specifications==2023.7.1
# via jsonschema
julius==0.2.7
# via demucs
kiwisolver==1.4.4
kiwisolver==1.4.5
# via matplotlib
lameenc==1.5.1
lameenc==1.6.3
# via demucs
lazy-loader==0.3
# via librosa
librosa==0.10.0.post2
# via -r requirements.in
llvmlite==0.40.1
llvmlite==0.41.1
# via numba
loguru==0.7.0
# via -r requirements.in
Expand All @@ -103,21 +101,21 @@ matplotlib==3.7.1
# via -r requirements.in
mdurl==0.1.2
# via markdown-it-py
more-itertools==9.1.0
more-itertools==10.1.0
# via htbuilder
mpmath==1.3.0
# via sympy
msgpack==1.0.5
msgpack==1.0.7
# via librosa
mutagen==1.46.0
mutagen==1.47.0
# via yt-dlp
networkx==3.1
networkx==3.2.1
# via torch
numba==0.57.1
numba==0.58.1
# via
# librosa
# resampy
numpy==1.24.4
numpy==1.26.1
# via
# altair
# contourpy
Expand All @@ -138,8 +136,9 @@ omegaconf==2.3.0
# via dora-search
openunmix==1.2.1
# via demucs
packaging==23.1
packaging==23.2
# via
# altair
# matplotlib
# pooch
# streamlit
Expand All @@ -148,29 +147,27 @@ pandas==1.5.3
# -r requirements.in
# altair
# streamlit
pillow==10.0.0
pillow==10.1.0
# via
# matplotlib
# streamlit
pooch==1.6.0
# via librosa
protobuf==3.20.3
protobuf==4.25.0
# via streamlit
pyarrow==12.0.1
pyarrow==14.0.1
# via streamlit
pycparser==2.21
# via cffi
pycryptodomex==3.18.0
pycryptodomex==3.19.0
# via yt-dlp
pydeck==0.8.1b0
# via streamlit
pydub==0.25.1
# via -r requirements.in
pygments==2.15.1
pygments==2.16.1
# via rich
pympler==1.0.1
# via streamlit
pyparsing==3.1.0
pyparsing==3.1.1
# via matplotlib
python-dateutil==2.8.2
# via
Expand All @@ -179,13 +176,13 @@ python-dateutil==2.8.2
# streamlit
pytube==12.1.3
# via -r requirements.in
pytz==2023.3
pytz==2023.3.post1
# via pandas
pyyaml==6.0
pyyaml==6.0.1
# via
# demucs
# omegaconf
referencing==0.29.1
referencing==0.30.2
# via
# jsonschema
# jsonschema-specifications
Expand All @@ -197,31 +194,31 @@ resampy==0.4.2
# via -r requirements.in
retrying==1.3.4
# via dora-search
rich==13.4.2
rich==13.6.0
# via streamlit
rpds-py==0.8.10
rpds-py==0.12.0
# via
# jsonschema
# referencing
scikit-learn==1.3.0
scikit-learn==1.3.2
# via librosa
scipy==1.11.1
scipy==1.11.3
# via
# librosa
# scikit-learn
six==1.16.0
# via
# python-dateutil
# retrying
smmap==5.0.0
smmap==5.0.1
# via gitdb
soundfile==0.12.1
# via librosa
soxr==0.3.5
soxr==0.3.7
# via librosa
stqdm==0.0.5
# via -r requirements.in
streamlit==1.22.0
streamlit==1.28.1
# via
# -r requirements.in
# stqdm
Expand All @@ -231,54 +228,55 @@ streamlit-option-menu==0.3.6
# via -r requirements.in
streamlit-player==0.1.5
# via -r requirements.in
submitit==1.4.5
submitit==1.5.1
# via dora-search
sympy==1.12
# via torch
tenacity==8.2.2
tenacity==8.2.3
# via streamlit
threadpoolctl==3.2.0
# via scikit-learn
toml==0.10.2
# via streamlit
toolz==0.12.0
# via altair
torch==2.0.1
torch==2.1.0
# via
# demucs
# diffq
# dora-search
# julius
# openunmix
# torchaudio
torchaudio==2.0.2
torchaudio==2.1.0
# via
# demucs
# openunmix
tornado==6.3.2
tornado==6.3.3
# via streamlit
tqdm==4.65.0
tqdm==4.66.1
# via
# demucs
# openunmix
# stqdm
treetable==0.2.5
# via dora-search
typing-extensions==4.7.1
typing-extensions==4.8.0
# via
# altair
# librosa
# streamlit
# submitit
# torch
tzlocal==5.0.1
tzlocal==5.2
# via streamlit
urllib3==2.0.3
urllib3==2.0.7
# via requests
validators==0.20.0
validators==0.22.0
# via streamlit
websockets==11.0.3
websockets==12.0
# via yt-dlp
yt-dlp==2023.7.6
# via -r requirements.in
zipp==3.16.2
zipp==3.17.0
# via importlib-metadata
16 changes: 16 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest
from streamlit.testing.v1 import AppTest


@pytest.fixture
def separate_running_app():
at = AppTest.from_file("app/pages/Separate.py")
at.run(timeout=10)
return at


@pytest.fixture
def karaoke_running_app():
at = AppTest.from_file("app/pages/Karaoke.py")
at.run(timeout=10)
return at
19 changes: 19 additions & 0 deletions tests/pages/test_Separate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest


def test_execution(separate_running_app):
assert not separate_running_app.exception


@pytest.mark.parametrize(
"selection",
[
"Vocals & Instrumental (Low Quality, Faster)",
"Vocals & Instrumental (High Quality, Slower)",
"Vocals, Drums, Bass & Other (Slower)",
"Vocal, Drums, Bass, Guitar, Piano & Other (Slowest)",
],
)
def test_separation_mode(selection, separate_running_app):
separate_running_app.selectbox(key="separation_mode").set_value(selection)
assert separate_running_app.selectbox(key="separation_mode").value == selection
Loading