Skip to content
Open
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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ updates:
directory: "/" # Workflow files stored in the default location of `.github/workflows`
schedule:
interval: "weekly"

- package-ecosystem: "pip" # Monitor Python dependencies in pyproject.toml
directory: "/"
schedule:
interval: "weekly"

# Note: PIXI lockfiles are handled by the update-lockfiles.yml workflow
# which automatically creates PRs for PIXI dependency updates
74 changes: 24 additions & 50 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@ name: conda packaging and deployment

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

jobs:
linux:
conda-publish:
name: build and upload to Anaconda
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3

- name: Setup Pixi
uses: prefix-dev/[email protected]
with:
auto-update-conda: true
channels: conda-forge,defaults
use-mamba: true
environment-file: environment.yml
activate-environment: test
- name: install additional dependencies
run: |
echo "installing additional dependencies from environment_development.yml"
- name: build conda package
pixi-version: v0.49.0
manifest-path: pyproject.toml

- name: Build package
run: |
# set up environment
cd conda.recipe
echo "versioningit $(versioningit ../)"
# build the package
VERSION=$(versioningit ../) conda mambabuild --channel conda-forge --channel mantid/label/nightly --channel mantid-ornl --channel mantid-ornl/label/rc --channel neutrons/label/rc --output-folder . .
conda verify noarch/snapwrap*.tar.bz2
- name: upload conda package to anaconda
shell: bash -l {0}
pixi run conda-build
mkdir -p /tmp/local-channel/linux-64
cp *.conda /tmp/local-channel/linux-64

- name: Verify conda package
uses: neutrons/conda-verify
with:
package-name: snapwrap
local-channel: /tmp/local-channel
python-version: "3.10"
extra-channels: mantid/labels/nightly neutrons

- name: Upload package to anaconda
if: startsWith(github.ref, 'refs/tags/v')
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
Expand All @@ -43,31 +44,4 @@ jobs:
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
anaconda upload --label $CONDA_LABEL conda.recipe/noarch/snapwrap*.tar.bz2

pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge,defaults
use-mamba: true
environment-file: environment.yml
activate-environment: test
- name: build pypi package
run: |
# build the package
VERSION=$(versioningit .) python -m build
# publish your distributions here (need to setup on PyPI first)
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
pixi run anaconda upload --label $CONDA_LABEL --user neutrons snapwrap-*.conda
54 changes: 0 additions & 54 deletions .github/workflows/package_pixi.yaml

This file was deleted.

34 changes: 9 additions & 25 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: unit-test
name: pixi unit-test

on:
workflow_dispatch:
Expand All @@ -10,38 +10,22 @@ on:
jobs:
linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
- uses: prefix-dev/setup-[email protected]
with:
auto-update-conda: true
channels: conda-forge,defaults
use-mamba: true
environment-file: environment.yml
activate-environment: test
- name: install additional dependencies
run: |
echo "installing additional dependencies if cannot be installed from conda"
pixi-version: v0.41.4
manifest-path: pyproject.toml
- name: run unit tests
run: |
echo "running unit tests"
python -m pytest --cov=src --cov-report=xml --cov-report=term-missing tests/
pixi run test
- name: upload coverage to codecov
uses: codecov/codecov-action@v5
if:
github.actor != 'dependabot[bot]'
if: github.actor != 'dependabot[bot]'
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: build conda package
- name: build test
run: |
# test that the conda package builds
cd conda.recipe
echo "versioningit $(versioningit ../)"
# conda channels could have been defined in the conda-incubator, but you can copy/paste the lines
# below to build the conda package in your local machine
CHANNELS="--channel mantid/label/main --channel conda-forge --channel mantid/label/nightly --channel mantid-ornl --channel mantid-ornl/label/rc --channel neutrons/label/rc"
VERSION=$(versioningit ../) conda mambabuild $CHANNELS --output-folder . .
conda verify noarch/snapwrap*.tar.bz2
echo "testing package build"
pixi run conda-build
31 changes: 0 additions & 31 deletions .github/workflows/unittest_pixi.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
testUtils.py
mantidlog.txt



# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -172,5 +170,8 @@ cython_debug/
# pixi environments
.pixi
*.egg-info
src/packagenamepy/_version.py

# Auto-generated version files
src/snapwrap/_version.py

snapwrap-*.conda
1 change: 0 additions & 1 deletion .pixi/config.toml

This file was deleted.

12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ repos:
- id: check-merge-conflict
- id: check-yaml
args: [--allow-multiple-documents]
exclude: "conda.recipe/meta.yaml"
- id: end-of-file-fixer
exclude: "tests/cis_tests/.*"
- id: trailing-whitespace
Expand All @@ -17,4 +16,13 @@ repos:
rev: v2.4.1
Copy link
Member

Choose a reason for hiding this comment

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

you may want to add a hook to check that the lockfile is up to date, I've found it really convenient since I tend to forget to run "pixi lock" before committing and then CI fails and I have to make another one file commit...

hooks:
- id: codespell
exclude: ".*\\.lock$|tests/cis_tests/.*"
exclude: ".*\\.lock$|tests/cis_tests/.*|pixi\\.lock"

- repo: local
hooks:
- id: pixi-lock
name: Check pixi lock file is up to date
entry: pixi install --locked
language: system
files: ^(pixi\.toml|pyproject\.toml)$
pass_filenames: false
12 changes: 8 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"
python: "3.8"
jobs:
pre_install:
- curl -fsSL https://pixi.sh/install.sh | bash
- export PATH="$HOME/.pixi/bin:$PATH"
post_install:
- pixi install
- pixi run build-docs

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true

conda:
environment: environment.yml
Loading
Loading