From 81b4c9fe77b6d4eef4877b6166a6630b665c1bf6 Mon Sep 17 00:00:00 2001 From: Brenden Pelkie Date: Wed, 6 Dec 2023 20:09:15 -0800 Subject: [PATCH 1/2] change rapsberry pi install detection to use platform_machine==aarch64 instead of system=linux --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b23e540..1a8f9a7 100644 --- a/setup.py +++ b/setup.py @@ -23,5 +23,5 @@ def read(fname): "Operating System :: POSIX :: Linux", ], python_requires='>=3.6', - install_requires=['pyserial==3.5', 'requests', 'ipykernel', 'numpy', 'opencv_contrib_python==4.5.3.56', 'matplotlib', "Jinja2", "sphinx", "sphinx-design", "pydata_sphinx_theme", "sphinx-autoapi", "picamera;platform_system=='Linux'"] + install_requires=['pyserial==3.5', 'requests', 'ipykernel', 'numpy', 'opencv_contrib_python==4.5.3.56', 'matplotlib', "Jinja2", "sphinx", "sphinx-design", "pydata_sphinx_theme", "sphinx-autoapi", "picamera;platform_machine=='aarch64'"] ) From 671246438e017057b289c87e5d1211475237e271 Mon Sep 17 00:00:00 2001 From: Brenden Pelkie Date: Wed, 6 Dec 2023 20:11:15 -0800 Subject: [PATCH 2/2] add yapf code formatting on PR --- .github/workflows/test-package.yml | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test-package.yml diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml new file mode 100644 index 0000000..68e0803 --- /dev/null +++ b/.github/workflows/test-package.yml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: test_package + +on: +# push: +# branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python -m pip install -e . + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Format code with yapf + run: + yapf -i -r . + #- name: Test with pytest + # run: | + #pytest