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
53 changes: 53 additions & 0 deletions .github/workflows/push_conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Conda package

on:
release:
types: [published]

# build the package (without uploading) when the packaging changes
pull_request:
paths:
- pyproject.toml
- .github/workflows/push_conda.yml

workflow_dispatch:
inputs:
release_tag:
description: "Release tag to simulate, e.g. v1.4.0"
required: true
type: string

upload:
description: "Actually upload package"
required: true
default: false
type: boolean

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v6
with:
ref: >-
${{ github.event_name == 'release'
&& github.event.release.tag_name
|| github.ref }}
fetch-depth: 0

- name: Build and publish
uses: khanlab/actions/.github/actions/action-pixi_task-publish@df4211abe672b61c81f4177eef5b9516edf2944e
with:
release-tag: >-
${{ github.event_name == 'release'
&& github.event.release.tag_name
|| github.event_name == 'pull_request'
&& format('v0.0.0.dev{0}', github.run_number)
|| inputs.release_tag }}
channel: akhanf/khanlab
api-key: ${{ secrets.PREFIX_API_KEY }}
upload: >-
${{ github.event_name == 'release'
|| inputs.upload == true }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ tests/test_results/
fireants/scripts/template/configs/test*.yaml
fireants/**/*debug/
**/.DS_Store

# pixi
.pixi/
pixi.lock
*.conda
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,46 @@ exclude = ["docker*", "notepad*", "fused_ops*", "tutorials*"]

[tool.hatch.build.targets.wheel]
packages = ["fireants"]

# ----------------------------------------------------------------------
# Conda package, built with pixi-build and published to akhanf/khanlab on
# release (.github/workflows/push_conda.yml). The run dependencies are listed
# here rather than converted from [project.dependencies], to relax the
# SimpleITK pin and leave out typing (stdlib) and pytest (tests only).
# ----------------------------------------------------------------------

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
preview = ["pixi-build"]

[tool.pixi.package]
name = "fireants"
# set from the release tag by the publish workflow
version = "0.0.0.dev0"
publish = true

[tool.pixi.package.build.backend]
name = "pixi-build-python"
version = "*"
channels = ["conda-forge"]

[tool.pixi.package.build.config]
ignore-pyproject-manifest = true

[tool.pixi.package.host-dependencies]
hatchling = ">=1.21.0"

[tool.pixi.package.run-dependencies]
python = ">=3.9"
pytorch = ">=2.3.0"
# the PyPI SimpleITK==2.2.1 pin is not needed, and conflicts with newer packages
simpleitk = ">=2.2.1"
nibabel = "*"
numpy = "*"
scipy = "*"
scikit-image = "*"
matplotlib-base = "*"
tqdm = "*"
pandas = "*"
hydra-core = "*"
Loading