From 1447be28c639e7589a5bc08d8637bf59c440d1ed Mon Sep 17 00:00:00 2001 From: Talon Chandler Date: Fri, 21 Feb 2025 17:30:13 -0800 Subject: [PATCH] copy iohub gh actions; remove tox --- .github/workflows/pytests.yml | 47 -------------- .github/workflows/test.yml | 31 ++++++++++ .github/workflows/test_and_deploy.yml | 88 --------------------------- tox.ini | 33 ---------- 4 files changed, 31 insertions(+), 168 deletions(-) delete mode 100644 .github/workflows/pytests.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/test_and_deploy.yml delete mode 100644 tox.ini diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml deleted file mode 100644 index 5ca47699..00000000 --- a/.github/workflows/pytests.yml +++ /dev/null @@ -1,47 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: pytests - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10", "3.11"] - - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install ".[dev]" - - # - name: Lint with flake8 - # run: | - # pip install flake8 - # # 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: Test with pytest - run: | - pytest -v - pytest --cov=./ --cov-report=xml - -# - name: Upload coverage to Codecov -# uses: codecov/codecov-action@v1 -# with: -# flags: unittest -# name: codecov-umbrella -# fail_ci_if_error: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..f69fd069 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: test + +on: [push] + +jobs: + test: + name: ${{ matrix.platform }} py${{ matrix.python-version }} + runs-on: ${{ matrix.platform }} + strategy: + max-parallel: 2 + matrix: + platform: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.10", "3.11"] + + steps: + - name: Checkout repo + 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 ".[dev]" + + - name: Test with pytest + run: | + pytest -v --cov=./ --cov-report=xml diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml deleted file mode 100644 index e30dee4e..00000000 --- a/.github/workflows/test_and_deploy.yml +++ /dev/null @@ -1,88 +0,0 @@ -# Modified from cookiecutter-napari-plugin -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -name: test-and-deploy - -on: - push: - branches: - - main - tags: - - "*" - pull_request: - branches: - - "*" - workflow_dispatch: - -jobs: - test: - name: ${{ matrix.platform }} py${{ matrix.python-version }} - runs-on: ${{ matrix.platform }} - strategy: - matrix: - platform: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.10", "3.11"] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - # these libraries enable testing on Qt on linux - - uses: tlambert03/setup-qt-libs@v1 - - # strategy borrowed from vispy for installing opengl libs on windows - - name: Install Windows OpenGL - if: runner.os == 'Windows' - run: | - git clone --depth 1 https://github.com/pyvista/gl-ci-helpers.git - powershell gl-ci-helpers/appveyor/install_opengl.ps1 - - # note: if you need dependencies from conda, considering using - # setup-miniconda: https://github.com/conda-incubator/setup-miniconda - # and - # tox-conda: https://github.com/tox-dev/tox-conda - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install setuptools tox tox-gh-actions - - # https://github.com/napari/cookiecutter-napari-plugin/commit/cb9a8c152b68473e8beabf44e7ab11fc46483b5d - - name: Test - uses: aganders3/headless-gui@v1 - with: - run: python -m tox - - - name: Coverage - uses: codecov/codecov-action@v3 - - deploy: - # this will run when you have tagged a commit with a version number - # and requires that you have put your twine API key in your - # github secrets (see readme for details) - needs: [test] - runs-on: ubuntu-latest - if: contains(github.ref, 'tags') - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -U setuptools setuptools_scm wheel twine build - -# skip build and publish for now -# - name: Build and publish -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} -# run: | -# git tag -# python -m build . -# twine upload --repository testpypi dist/* # Commented until API key is on github diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 67c53b18..00000000 --- a/tox.ini +++ /dev/null @@ -1,33 +0,0 @@ -# Modified from from cookiecutter-napari-plugin -# For more information about tox, see https://tox.readthedocs.io/en/latest/ -[tox] -envlist = py{310,311}-{linux,macos,windows} -isolated_build=true - -[gh-actions] -python = - 3.10: py310 - 3.11: py311 - -[gh-actions:env] -PLATFORM = - ubuntu-latest: linux - macos-latest: macos - windows-latest: windows - -[testenv] -platform = - macos: darwin - linux: linux - windows: win32 -passenv = - CI - GITHUB_ACTIONS - DISPLAY - XAUTHORITY - NUMPY_EXPERIMENTAL_ARRAY_FUNCTION - PYVISTA_OFF_SCREEN -extras = - dev - all -commands = pytest -v --color=yes --cov=recOrder --cov-report=xml \ No newline at end of file