-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into async-play.
- Loading branch information
Showing
17 changed files
with
246 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[run] | ||
branch = True | ||
omit = | ||
*/nava/__main__.py | ||
*/nava/__init__.py | ||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Linux | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
TEST_PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Installation | ||
run: | | ||
sudo python -m pip install --upgrade pip | ||
sudo pip install -r requirements.txt | ||
sudo python setup.py install | ||
- name: First test | ||
run: | | ||
sudo nava | ||
- name: Install ALSA | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install alsa-utils | ||
sudo apt-get install alsa-tools | ||
sudo apt-get install alsa-firmware-loaders | ||
sudo apt-get install alsa-oss | ||
sudo apt-get install -y software-properties-common | ||
sudo apt-get install linux-modules-extra-$(uname -r) | ||
sudo modprobe snd-dummy | ||
- name: Test requirements Installation | ||
run: | | ||
sudo python others/requirements-splitter.py | ||
sudo pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
sudo python -m pytest --cov=nava --cov-report=term | ||
- name: Other tests | ||
run: | | ||
sudo python -m vulture nava/ others/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size | ||
sudo python -m bandit -r nava -s B404,B603,B605,B607 | ||
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 | ||
with: | ||
fail_ci_if_error: false | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION | ||
- name: Version check | ||
run: | | ||
python others/version_check.py | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: publish_conda | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: publish-to-conda | ||
uses: sepandhaghighi/conda-package-publish-action@v1.2 | ||
with: | ||
subDir: 'others' | ||
AnacondaToken: ${{ secrets.ANACONDA_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Windows | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
TEST_PYTHON_VERSION: 3.9 | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2022, windows-2019] | ||
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0, 3.11.0] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Installation | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
python setup.py install | ||
- name: First test | ||
run: | | ||
nava | ||
- name: Install Scream | ||
shell: powershell | ||
run: | | ||
Start-Service audio* | ||
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip | ||
Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream | ||
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate | ||
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine") | ||
$store.Open("ReadWrite") | ||
$store.Add($cert) | ||
$store.Close() | ||
cd C:\Scream\Install\driver | ||
C:\Scream\Install\helpers\devcon install Scream.inf *Scream | ||
- name: Test requirements Installation | ||
run: | | ||
python others/requirements-splitter.py | ||
pip install --upgrade --upgrade-strategy=only-if-needed -r test-requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
python -m pytest --cov=nava --cov-report=term | ||
- name: Other tests | ||
run: | | ||
python -m vulture nava/ others/ setup.py --min-confidence 65 --exclude=__init__.py --sort-by-size | ||
python -m bandit -r nava -s B404,B603,B605,B607 | ||
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 | ||
with: | ||
fail_ci_if_error: false | ||
if: matrix.python-version == env.TEST_PYTHON_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
codecov: | ||
require_ci_to_pass: yes | ||
notify: | ||
after_n_builds: 3 | ||
wait_for_ci: yes | ||
|
||
coverage: | ||
precision: 2 | ||
round: up | ||
range: "70...100" | ||
status: | ||
patch: | ||
default: | ||
enabled: no | ||
project: | ||
default: | ||
threshold: 1% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{% set name = "nava" %} | ||
{% set version = "0.1" %} | ||
{% set version = "0.2" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
import sys | ||
import codecs | ||
Failed = 0 | ||
NAVA_VERSION = "0.1" | ||
NAVA_VERSION = "0.2" | ||
|
||
|
||
SETUP_ITEMS = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# content of pytest.ini | ||
[pytest] | ||
addopts = --doctest-modules --ignore=others | ||
doctest_optionflags= NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
>>> from nava import play | ||
>>> play("test.wav") | ||
Traceback (most recent call last): | ||
... | ||
nava.errors.NavaBaseError: Given sound file doesn't exist. | ||
>>> play(1) | ||
Traceback (most recent call last): | ||
... | ||
nava.errors.NavaBaseError: Sound file's path should be a string. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
>>> import os | ||
>>> from nava import play | ||
>>> play(os.path.join("others", "test.wav")) | ||
>>> from nava.functions import nava_help | ||
>>> nava_help() | ||
<BLANKLINE> | ||
A Python library for playing sound everywhere natively and securely. | ||
<BLANKLINE> | ||
<BLANKLINE> | ||
Repo : https://github.com/openscilab/nava | ||
Webpage : https://openscilab.com/ | ||
""" |