Skip to content
Open
72 changes: 58 additions & 14 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.9, "3.10"]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v4
Expand All @@ -38,39 +38,83 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# these libraries enable testing on Qt on linux
# These libraries enable testing on Qt on linux
- uses: tlambert03/setup-qt-libs@v1

# strategy borrowed from vispy for installing opengl libs on windows
# 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
if (Test-Path -Path "C:\Windows\system32\opengl32.dll" -PathType Leaf) {Exit 0} else {Exit 1}

# 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
# Set up Miniconda
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}

# Initialize Conda on Linux/macOS
- name: Initialize Conda (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -l {0}
run: |
conda init bash

- name: Create and activate environment (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -l {0}
run: |
conda create --name test-env python=${{ matrix.python-version }} -y
source activate test-env
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should fix the failing activate

Suggested change
source activate test-env
conda activate test-env

conda install -c conda-forge pytables==3.8.0 -y
python -m pip install --upgrade pip
python -m pip install setuptools tox tox-gh-actions

# this runs the platform-specific tests declared in tox.ini
- name: Test with tox
uses: aganders3/headless-gui@v2
with:
run: python -m tox
# Initialize Conda on Windows
- name: Initialize Conda (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
C:\Miniconda\Scripts\conda.exe init powershell

- name: Create and activate environment (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
C:\Miniconda\Scripts\conda.exe create --name test-env python=${{ matrix.python-version }} -y
conda activate test-env
C:\Miniconda\Scripts\conda.exe install -c conda-forge pytables==3.8.0 -y
python -m pip install --upgrade pip
python -m pip install setuptools tox tox-gh-actions

# This runs the platform-specific tests declared in tox.ini
- name: Test with tox (Linux/macOS)
if: runner.os != 'Windows'
shell: bash -l {0}
run: |
source activate test-env
python -m tox
env:
PLATFORM: ${{ matrix.platform }}

- name: Test with tox (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
conda activate test-env
python -m tox
env:
PLATFORM: ${{ matrix.platform }}

- name: Coverage
uses: codecov/codecov-action@v4

deploy:
# this will run when you have tagged a commit, starting with "v*"
# This will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [test]
Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering :: Artificial Intelligence
Topic :: Scientific/Engineering :: Image Processing
Expand All @@ -41,8 +40,7 @@ install_requires =
qtpy>=2.4
scikit-image
scipy
tables
python_requires = >=3.9
python_requires = >=3.10
include_package_data = True
package_dir =
=src
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{39,310}-{linux,macos,windows}
envlist = py{310}-{linux,macos,windows}
isolated_build=true

[gh-actions]
python =
3.9: py39
3.10: py310

[gh-actions:env]
Expand Down
Loading