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

CLI error message #48

Merged
merged 11 commits into from
May 24, 2024
6 changes: 4 additions & 2 deletions .github/workflows/linux_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0, 3.12.0]
Expand Down Expand Up @@ -54,9 +55,10 @@ jobs:
sudo python -m pydocstyle -v --match-dir=nava
if: matrix.python-version == env.TEST_PYTHON_VERSION
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: matrix.python-version == env.TEST_PYTHON_VERSION
- name: Version check
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/macOS_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-12, macOS-11]
os: [macOS-12, macOS-13]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0, 3.12.0]
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -44,7 +45,8 @@ jobs:
python -m pydocstyle -v --match-dir=nava
if: matrix.python-version == env.TEST_PYTHON_VERSION
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: matrix.python-version == env.TEST_PYTHON_VERSION
6 changes: 4 additions & 2 deletions .github/workflows/windows_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022, windows-2019]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0, 3.12.0]
Expand Down Expand Up @@ -59,7 +60,8 @@ jobs:
python -m pydocstyle -v --match-dir=nava
if: matrix.python-version == env.TEST_PYTHON_VERSION
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
if: matrix.python-version == env.TEST_PYTHON_VERSION
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- `main` function updated
- OSs local checklist added to pull request template
- Test system modified
- `README.md` modified
## [0.5] - 2024-04-03
### Changed
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
codecov:
require_ci_to_pass: yes
notify:
notify:
after_n_builds: 3
wait_for_ci: yes

Expand Down
5 changes: 3 additions & 2 deletions nava/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def play_cli(sound_path, loop=False):
play(sound_path)
if not loop:
break
except KeyboardInterrupt:
except NavaBaseError as e:
print("Error: {0}".format(e))
finally:
stop_all()
sys.exit(0)
3 changes: 3 additions & 0 deletions test/error_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
Traceback (most recent call last):
...
nava.errors.NavaBaseError: `loop` can not be set True when `async_mode` is False.
>>> import nava
>>> nava.functions.play_cli("test2.wav")
Error: Given sound file doesn't exist.
"""
1 change: 1 addition & 0 deletions test/function_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
True
>>> nava.params._play_threads_counter == 44
True
>>> nava.functions.play_cli(os.path.join("others", "test.wav"))
>>> nava.functions.nava_help()
<BLANKLINE>
A Python library for playing sound everywhere natively and securely.
Expand Down
Loading