Skip to content

Remove external dependency on 'mock' #9

Remove external dependency on 'mock'

Remove external dependency on 'mock' #9

Workflow file for this run

name: build and test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: ${{ matrix.config.name }} (Python ${{ matrix.python-version }})
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.11, 3.12, 3.13]
config:
- {
name: Linux,
os: ubuntu-latest
}
defaults:
run:
# Using a login shell is necessary to persist the conda environment
shell: bash -l {0}
steps:
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
conda-remove-defaults: "true"
auto-update-conda: true
conda-solver: libmamba
python-version: ${{ matrix.python-version }}
activate-environment: tomviz
- name: Checkout Tomviz
uses: actions/checkout@v5
with:
submodules: recursive
path: tomviz
- name: Install Build Requirements
# I can't get the defaults channel fully removed, so we have to
# --override-channels here.
run: |
conda install -y --override-channels -c conda-forge --file tomviz/.github/workflows/build_requirements.txt
# Record the whole build environment for caching
conda env export > build_env.yml
echo "build_env.yml file contents is:"
cat build_env.yml
- name: Build Tomviz
run: bash tomviz/.github/workflows/scripts/build_tomviz.sh
- name: Install Runtime Requirements
# I can't get the defaults channel fully removed, so we have to
# --override-channels here.
run: conda install -y --override-channels -c conda-forge --file tomviz/.github/workflows/runtime_requirements.txt
- name: Install Test Requirements
run: |
conda install -y --override-channels -c conda-forge --file tomviz/tests/python/requirements-dev.txt
pip install --no-build-isolation --no-deps -U tomviz/tomviz/python
pip install --no-build-isolation --no-deps -U tomviz/acquisition
# These do not have to be in the same environment as Tomviz, but the dependencies
# are so far compatible and we'll just let it go for the tests.
conda install -y --override-channels -c conda-forge --file tomviz/.github/workflows/pyxrf_requirements.txt
pip install --no-build-isolation --no-deps -U tomviz/tomviz/python/tomviz/pyxrf/pyxrf-utils
- name: Run Tests
env:
# Make sure the Qt tests run offscreen
QT_QPA_PLATFORM: offscreen
TOMVIZ_REQUIRE_PYXRF: true
run: |
cd tomviz-build
export TOMVIZ_TEST_PYTHON_EXECUTABLE=$(which python3)
ctest --output-on-failure
- name: Upload CTest Log (On Failure Only)
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: TomvizCTestLog_${{ matrix.config.name }}_Py${{ matrix.python-version }}.log
path: tomviz-build/Testing/Temporary/LastTest.log