Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 0 additions & 147 deletions .github/workflows/ci.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pixi Packaging and Deployment

on:
workflow_dispatch:
push:
branches: [main]
tags: ['v*']
pull_request:
# Run on pull requests targeting any base branch

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for accurate versioning
fetch-tags: true # Fetch tags to ensure versioning works correctly
- uses: prefix-dev/setup-pixi@v0.8.8
with:
pixi-version: v0.41.4
manifest-path: pyproject.toml
- name: Build python wheel # cannot be used without mantid
run: pixi run build-wheel
# We dont need pypi for now
# - name: build pypi package
# run: |
# pixi run build-pypi
- name: build conda package
run: pixi run build-conda
- name: upload conda package to anaconda
if: startsWith(github.ref, 'refs/tags/v')
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
IS_RC: ${{ contains(github.ref, 'rc') }}
run: |
# label is main or rc depending on the tag-name
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
pixi run anaconda upload --label $CONDA_LABEL --user neutrons pyrs-*.conda
71 changes: 71 additions & 0 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: unit-test

on:
workflow_dispatch:
pull_request:
push:
branches: [next, qa, main]
tags: ['v*']

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: prefix-dev/setup-pixi@v0.8.8
with:
pixi-version: v0.41.4
manifest-path: pyproject.toml
- name: Apt install deps
run: |
sudo apt update
sudo apt-get install xvfb freeglut3-dev libglu1-mesa
- name: Start xvfb daemon
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
- name: Mantid pre-requisites - create a properties file that turns off network access
run: |
mkdir ~/.mantid
echo "CheckMantidVersion.OnStartup=0" > ~/.mantid/Mantid.user.properties
echo "UpdateInstrumentDefinitions.OnStartup=0" >> ~/.mantid/Mantid.user.properties
echo "usagereports.enabled=0" >> ~/.mantid/Mantid.user.properties
- name: Test framework imports
run: pixi run test-import-framework
- name: run unit tests
run: |
echo "running unit tests"
xvfb-run --server-args="-screen 0 1280x1024x16" -a pixi run test
- name: List coverage files (debug)
run: |
echo "Coverage files generated:"
ls -la coverage.xml || echo "No coverage.xml found"
ls -la .coverage || echo "No .coverage found"
- name: upload coverage to codecov
uses: codecov/codecov-action@v5
if: github.actor != 'dependabot[bot]'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: prefix-dev/setup-pixi@v0.8.8
with:
pixi-version: v0.41.4
manifest-path: pyproject.toml
- name: flake8
run: pixi run lint-flake8
- name: mypy
run: pixi run mypy pyrs scripts tests
38 changes: 11 additions & 27 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,40 +30,24 @@ Developer Quick Start

If you've never used PyRS before, you can get started quickly by doing the following.

1. Install basic dependencies: Conda, Python, and PyQt. Conda installation requires linux.
2. Create a new Conda environment with additional dependencies:
1. Install basic dependencies: Pixi, Python, and PyQt. Pixi installation requires linux.
2. Create a new Pixi environment with additional dependencies:

Installation using an anaconda environment
Installation using a Pixi environment
------------------------------------------
Anaconda environments are only supported on OSx (x86) and Linux using python 3.10
Pixi environments are only supported on OSx (x86) and Linux using python 3.11

1. Configure anaconda environment:
1. Configure Pixi environment:

.. code-block::

conda install -c conda-forge mamba
pixi install

.. code-block::

mamba env create --name pyrs --file environment.yml

2. Activate the conda environment

.. code-block::

conda activate pyrs

3. From the PyRS directory, run the setup script in developer mode

.. code-block::

python setup.py build

4. From the PyRS directory, start the user interface
2. Run PyRs with Pixi:

.. code-block::

PYTHONPATH=$PWD:$PYTHONPATH python scripts/pyrsplot
pixi run pyrs

Running and developing PyRS
---------------------------
Expand All @@ -72,22 +56,22 @@ To start main window from analysis machine

.. code-block::

PYTHONPATH=$PWD:$PYTHONPATH python scripts/pyrsplot
pixi run pyrs

To develop

To run all of the tests

.. code-block::

python -m pytest
pixi run test

Running specific tests can be done `through standard ways`
<https://docs.pytest.org/en/stable/usage.html>`_. For example

.. code-block::

python -m pytest tests/unit
pixi run python -m pytest tests/unit

will only run the unit tests

Expand Down
Loading
Loading