-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
313 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% set name = "torch-distmap" %} | ||
{% set version = "0.1.0" %} | ||
|
||
package: | ||
name: "{{ name|lower }}" | ||
version: "{{ version }}" | ||
|
||
source: | ||
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz | ||
sha256: dbc57eaa42d037bc31ff2d8702928bcc05de44cfaf7b57b2ba784551e91a244a | ||
|
||
build: | ||
number: 0 | ||
script: {{ PYTHON }} -m pip install . -vv | ||
noarch: python | ||
|
||
requirements: | ||
host: | ||
- python >=3.6 | ||
- pip | ||
run: | ||
- python >=3.6 | ||
- pytorch >=1.3 | ||
|
||
test: | ||
imports: | ||
- distmap | ||
|
||
about: | ||
home: https://github.com/balbasty/torch-distmap | ||
license: MIT | ||
summary: Euclidean distance transform in PyTorch | ||
dev_url: https://github.com/balbasty/torch-distmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: conda | ||
description: Publish to Anaconda | ||
inputs: | ||
tag: | ||
description: 'Commit / Branch / Tag / SHA to checkout' | ||
required: false | ||
default: '' | ||
platforms: | ||
description: 'Platforms [all noarch osx-64 osx-arm64 linux-32 linux-ppc64 linux-ppc64le linux-s390x linux-armv6l linux-armv7l linux-aarch64 win-32 win-64]' | ||
required: false | ||
default: 'noarch' | ||
python-version: | ||
description: 'One or multiple python versions' | ||
required: false | ||
default: 3.7 | ||
dry-run: | ||
description: 'Dry run' | ||
required: false | ||
default: false | ||
override: | ||
description: 'Override' | ||
required: false | ||
default: true | ||
password: | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- shell: bash | ||
env: | ||
TAG: ${{ inputs.tag }} | ||
PLATFORMS: ${{ inputs.platforms }} | ||
DRYRUN: ${{ inputs.dry-run }} | ||
OVERRIDE: ${{ inputs.override }} | ||
run: echo "$TAG // $PLATFORMS // $DRYRUN // $OVERRIDE" | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ inputs.tag }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
mamba-version: "*" | ||
channels: conda-forge,defaults | ||
channel-priority: true | ||
activate-environment: build | ||
- name: Install boa / anaconda | ||
shell: bash -el {0} | ||
run: | | ||
mamba install boa anaconda-client | ||
- name: Build | ||
shell: bash -el {0} | ||
env: | ||
PY: ${{ inputs.python-version }} | ||
run: | | ||
PY=($PY) | ||
OPT="" | ||
for V in "${PY[@]}"; do | ||
OPT+=",${V}" | ||
done | ||
OPT="{python: [${OPT:1}]}" | ||
conda mambabuild --variants "$OPT" -c pytorch --croot . .conda | ||
- name: Convert | ||
shell: bash -el {0} | ||
env: | ||
PLATFORMS: ${{ inputs.platforms }} | ||
run: | | ||
for PLATFORM in osx-64 osx-arm64 linux-32 linux-64 linux-ppc64 linux-s390x linux-armv6l linux-armv7l linux-aarch64 win-32 win-64 | ||
do | ||
if [[ $PLATFORMS == *"all"* || $PLATFORMS == *"${PLATFORM}"* ]]; then | ||
conda convert -p $PLATFORM linux-64/*.tar.bz2 | ||
fi | ||
done | ||
- name: "Publish (dry run: ${{ inputs.dry-run }})" | ||
if: inputs.dry-run == 'false' | ||
shell: bash -el {0} | ||
env: | ||
OVERRIDE: ${{ inputs.override }} | ||
PLATFORMS: ${{ inputs.platforms }} | ||
ANACONDA_API_TOKEN: ${{ inputs.password }} | ||
run: | | ||
export ANACONDA_API_TOKEN | ||
[[ "${OVERRIDE}" == "true" ]] && FORCE="--force" || FORCE="" | ||
for PLATFORM in noarch osx-64 osx-arm64 linux-32 linux-64 linux-ppc64 linux-s390x linux-armv6l linux-armv7l linux-aarch64 win-32 win-64 | ||
do | ||
if [[ $PLATFORMS == *"all"* || $PLATFORMS == *"${PLATFORM}"* ]]; then | ||
anaconda upload ${FORCE} --label main ${PLATFORM}/*.tar.bz2 | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Run tests | ||
description: Run tests | ||
inputs: | ||
tag: | ||
description: 'Commit / Branch / Tag / SHA to checkout' | ||
required: false | ||
default: '' | ||
python-version: | ||
description: 'Python version' | ||
required: true | ||
default: '3.6' | ||
pytorch-version: | ||
description: 'PyTorch version' | ||
required: true | ||
default: '1.8' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
mamba-version: "*" | ||
python-version: ${{ inputs.python-version }} | ||
channels: conda-forge,pytorch,defaults | ||
activate-environment: test-env | ||
- name: Install dependencies | ||
shell: bash -el {0} | ||
env: | ||
PYTORCH_VERSION: ${{ inputs.pytorch-version }} | ||
run: | | ||
mamba install pytorch=${PYTORCH_VERSION} pytest | ||
- name: Test with pytest | ||
shell: bash -el {0} | ||
run: | | ||
pip install . | ||
pytest pytest --pyargs distmap |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Test package and publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Commit / Branch / Tag / SHA to checkout' | ||
required: false | ||
default: '' | ||
test: | ||
description: 'Run tests' | ||
required: false | ||
default: true | ||
type: boolean | ||
publish: | ||
description: 'Publish' | ||
required: false | ||
default: 'none' | ||
type: choice | ||
options: | ||
- 'none' | ||
- 'pypi' | ||
- 'test' | ||
- 'conda' | ||
- 'dryconda' | ||
- 'test+pypi' | ||
- 'pypi+conda' | ||
- 'test+pypi+conda' | ||
python-version: | ||
description: 'Python version' | ||
required: false | ||
default: '3.7' | ||
conda-platforms: | ||
description: 'Target platforms' | ||
required: false | ||
default: 'noarch' | ||
|
||
jobs: | ||
test: | ||
if: inputs.test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- python-version: "3.7" | ||
pytorch-version: "1.4" | ||
- python-version: "3.7" | ||
pytorch-version: "1.8" | ||
- python-version: "3.9" | ||
pytorch-version: "1.11" | ||
- python-version: "3.11" | ||
pytorch-version: "2.0" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/test | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
pytorch-version: ${{ matrix.pytorch-version }} | ||
tag: ${{ inputs.tag }} | ||
|
||
publish: | ||
if: inputs.test && inputs.publish != 'none' | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/pypi | ||
if: | | ||
contains(inputs.publish, 'pypi') || contains(inputs.publish, 'test') | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
publish: ${{ inputs.publish }} | ||
tag: ${{ inputs.tag }} | ||
pypi-password: ${{ secrets.PYPI_TOKEN }} | ||
test-password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
- uses: ./.github/actions/conda | ||
if: contains(inputs.publish, 'conda') | ||
with: | ||
tag: ${{ inputs.tag }} | ||
platforms: ${{ inputs.conda-platforms }} | ||
dry_run: ${{ contains(inputs.publish, 'dry') }} | ||
password: ${{ secrets.ANACONDA_TOKEN }} | ||
|
||
publish-only: | ||
if: (!inputs.test) && inputs.publish != 'none' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/pypi | ||
if: | | ||
contains(inputs.publish, 'pypi') || contains(inputs.publish, 'test') | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
publish: ${{ inputs.publish }} | ||
tag: ${{ inputs.tag }} | ||
pypi-password: ${{ secrets.PYPI_TOKEN }} | ||
test-password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
- uses: ./.github/actions/conda | ||
if: contains(inputs.publish, 'conda') | ||
with: | ||
tag: ${{ inputs.tag }} | ||
platforms: ${{ inputs.conda-platforms }} | ||
dry-run: ${{ contains(inputs.publish, 'dry') }} | ||
password: ${{ secrets.ANACONDA_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.