Skip to content

Commit

Permalink
simplified / created train environment and testenv in tox.ini and pyp…
Browse files Browse the repository at this point in the history
…roject.toml. Moved all tests relating to data into their own test directory. Updated path to resources accordingly.
  • Loading branch information
bgenchel committed Apr 24, 2024
1 parent bfede5c commit 4975d82
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies = [
"apache_beam",
"librosa>=0.8.0",
"mir_eval>=0.6",
"mirdata",
"numpy>=1.18",
"onnxruntime; platform_system == 'Windows' and python_version < '3.11'",
"pretty_midi>=0.2.9",
Expand All @@ -32,8 +31,6 @@ dependencies = [
"tensorflow>=2.4.1,<2.15.1; platform_system != 'Darwin' and python_version >= '3.11'",
"tensorflow-macos>=2.4.1,<2.15.1; platform_system == 'Darwin' and python_version > '3.11'",
"tflite-runtime; platform_system == 'Linux' and python_version < '3.11'",
"smart_open",
"sox",
"typing_extensions",
]

Expand All @@ -56,6 +53,7 @@ basic-pitch = "basic_pitch.predict:main"

[project.optional-dependencies]
train = [
"basic_pitch[tf,test]",
"apache_beam",
"mirdata",
"smart_open",
Expand All @@ -77,7 +75,7 @@ coreml = ["coremltools"]
onnx = ["onnxruntime"]
docs = ["mkdocs>=1.0.4"]
dev = [
"basic_pitch[test,tf,coreml,onnx,docs]",
"basic_pitch[train,test,tf,coreml,onnx,docs]",
"mypy",
"tox",
"mirdata"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_guitarset.py → tests/data/test_guitarset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
from basic_pitch.data.pipeline import WriteBatchToTfRecord

RESOURCES_PATH = pathlib.Path(__file__).parent / "resources"
RESOURCES_PATH = pathlib.Path(__file__).parent.parent / "resources"
TRACK_ID = "00_BN1-129-Eb_comp"


Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 10 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires =
[testenv]
deps = -e .[test]
commands =
pytest tests --ignore tests/test_nn.py {posargs}
pytest tests --ignore tests/test_nn.py --ignore tests/data {posargs}
setenv =
SOURCE = {toxinidir}/basic_pitch
TEST_SOURCE = {toxinidir}/tests
Expand All @@ -27,6 +27,15 @@ setenv =
TEST_SOURCE = {toxinidir}/tests
LINE_LENGTH = "120"

[testenv:train]
deps = -e .[train]
commands =
pytest tests/data {posargs}
setenv =
SOURCE = {toxinidir}/basic_pitch
TEST_SOURCE = {toxinidir}/tests/data
LINE_LENGTH = "120"

[testenv:manifest]
deps = check-manifest
skip_install = true
Expand Down

0 comments on commit 4975d82

Please sign in to comment.