diff --git a/.github/workflows/buddy-build.yml b/.github/workflows/buddy-build.yml new file mode 100644 index 0000000..6037625 --- /dev/null +++ b/.github/workflows/buddy-build.yml @@ -0,0 +1,38 @@ +name: Buddy Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.11, 3.13] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel pytest responses + + - name: Build + env: + CI: 1 + run: | + python setup.py sdist bdist_wheel + + - name: Install wheel + run: + pip install dist/amcrest-*.whl + + - name: Test + run: | + pytest -v diff --git a/.gitignore b/.gitignore index 57bb572..2df561f 100644 --- a/.gitignore +++ b/.gitignore @@ -105,5 +105,6 @@ ENV/ # Rope project settings .ropeproject -# Vim temporary files +# Vim/emacs temporary/backup files *.swp +*~ diff --git a/setup.py b/setup.py index 539946a..098e047 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def readme(): setup( name="amcrest", - version="1.9.9", + version="1.9.10", description="Python wrapper implementation for Amcrest cameras.", long_description=readme(), author="Douglas Schilling Landgraf, Marcelo Moreira de Mello", diff --git a/src/amcrest/utils.py b/src/amcrest/utils.py index a54d7b6..b0b37bb 100644 --- a/src/amcrest/utils.py +++ b/src/amcrest/utils.py @@ -51,7 +51,15 @@ def str2bool(value: Union[str, int]) -> bool: False values: n, no, false, off, 0 """ if isinstance(value, str): - return value.lower() in ("y", "yes", "on", "1", "true", "t") + valueCompare = value.lower() + + if valueCompare in ("y", "yes", "on", "1", "true", "t"): + return True + elif valueCompare in ("n", "no", "off", "0", "false"): + return False + else: + raise ValueError(value) + return bool(value)