Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
42 changes: 11 additions & 31 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: conda packaging and deployment
name: pixi packaging and deployment

on:
workflow_dispatch:
Expand All @@ -9,31 +9,17 @@ 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 from environment_development.yml"
pixi-version: v0.41.4
manifest-path: pyproject.toml
- name: build conda 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
echo "build and verify conda package"
pixi run verify-conda
- name: upload conda package to anaconda
shell: bash -l {0}
if: startsWith(github.ref, 'refs/tags/v')
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
Expand All @@ -43,30 +29,24 @@ 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
pixi run -- 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
- 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
pixi-version: v0.41.4
manifest-path: pyproject.toml
- name: build pypi package
run: |
# build the package
VERSION=$(versioningit .) python -m build
pixi run build-pypi
# publish your distributions here (need to setup on PyPI first)
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
32 changes: 8 additions & 24 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
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 "build and verify conda package"
pixi run verify-conda
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,11 @@ cython_debug/
*.egg-info
src/packagenamepy/_version.py

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

# Conda build artifacts
conda.recipe/linux-64/
conda.recipe/noarch/
conda.recipe/channeldata.json
conda.recipe/index.html
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ 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"
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