Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replaces setup.py with pyproject.toml and poetry #131

Merged
merged 4 commits into from
Dec 18, 2021
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
9 changes: 8 additions & 1 deletion .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,20 @@ jobs:
run: |
echo "NEW_BUMP=$(($BUMP_VER + 1))" >> $GITHUB_ENV

- name: Update version in files
- name: Update version in pyproject
uses: jacobtomlinson/gha-find-replace@master
with:
include: 'pyproject.toml'
find: 'version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"'
replace: 'version = "${{ steps.release-drafter.outputs.name }}-pre.${{ env.NEW_BUMP }}"'

- name: Update version in pipeline_description
uses: jacobtomlinson/gha-find-replace@master
with:
include: 'hippunfold/pipeline_description.json'
find: 'version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"'
replace: 'version = "${{ steps.release-drafter.outputs.name }}-pre.${{ env.NEW_BUMP }}"'

- name: Commit updates
env:
SNAKEBIDS_VERSION: ${{ steps.release-drafter.outputs.name }}-pre.${{ env.NEW_BUMP }}
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Deploy workflow

on:
workflow_dispatch:
inputs:
author:
description: "Author"
required: true
default: "github-actions[bot] (user publishing release)"
date:
description: "Date"
required: true
default: "YYYY-MM-DD"
comments:
description: "Comments"

jobs:
release_changelog:
runs-on: ubuntu-latest

steps:
- name: Print author
run: |
echo "Author: ${{ github.event.inputs.author }}"
echo "Date: ${{ github.event.inputs.date }}"
echo "Comments: ${{ github.event.inputs.comments }}"

- uses: actions/checkout@master
with:
ref: refs/heads/master

- name: Draft change log
uses: release-drafter/release-drafter@v5
id: release-drafter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update version in pyproject
uses: jacobtomlinson/gha-find-replace@master
with:
include: 'pyproject.toml'
find: 'version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"'
replace: 'version = "${{ steps.release-drafter.outputs.name }}-pre.${{ env.NEW_BUMP }}"'

- name: Update version in pipeline_description
uses: jacobtomlinson/gha-find-replace@master
with:
include: 'hippunfold/pipeline_description.json'
find: 'version = "(?:([0-9]+\.[0-9]+\.[0-9]+.+)|([0-9]+\.[0-9]+\.[0-9]+))"'
replace: 'version = "${{ steps.release-drafter.outputs.name }}-pre.${{ env.NEW_BUMP }}"'

- name: Commit updates
env:
LATEST_VERSION: ${{ steps.release-drafter.outputs.name }}
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff-index --quiet HEAD || git commit -m "Bump version to $LATEST_VERSION" -a

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish change log
uses: release-drafter/release-drafter@v5
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy:
runs-on: ubuntu-latest
needs: [release_changelog]

steps:
- uses: actions/checkout@master
with:
ref: refs/heads/master

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Build and publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry publish --build

2 changes: 1 addition & 1 deletion .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-console-scripts
python -m pip install -e .
python -m pip install .
# - name: Lint with flake8
# run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
9 changes: 2 additions & 7 deletions docs/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,9 @@ Option 2:

This assumes you have created and activated a virtualenv or conda environment first.

#. Clone the repository::

git clone --recursive http://github.com/khanlab/hippunfold

#. Install hippunfold using pip, with the -e option (for development mode)::
#. Install hippunfold using pip::

pip install -e ./hippunfold
pip install hippunfold

#. Run the following to download the U-net models::

Expand All @@ -96,7 +92,6 @@ This assumes you have created and activated a virtualenv or conda environment fi




Additional instructions for Compute Canada
------------------------------------------

Expand Down
27 changes: 24 additions & 3 deletions hippunfold/config/snakebids.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bids_dir: '/path/to/bids/dir'
output_dir: '/path/to/output/dir' #don't use '.'
bids_dir: '../test_data/bids_singleT2w'
output_dir: 'test_output' #don't use '.'

snakebids_dir: '.' #do not modify this variable -- is used to refer to files needed by the workflow when running with CLI
snakemake_dir: '/localscratch/hippunfold_warps/hippunfold' #do not modify this variable -- is used to refer to files needed by the workflow when running with CLI

#enable printing debug statements during parsing -- disable if generating dag visualization
debug: False
Expand Down Expand Up @@ -365,6 +365,27 @@ laplace_labels:
- 0


output_spaces:
- cropT1w

participant_label:
exclude_participant_label:
hemi:
- L
- R
output_density:
- 2k
- 7k

laminar_coords_method: equivolume
skip_preproc: False
nnunet_disable_tta: False
use_gpu: False
skip_coreg: False
keep_work: False
skip_inject_template_labels: False


#---- dwi options below, not used in the default workflow ----

#eddy options only used for experimental dwi workflow
Expand Down
2 changes: 1 addition & 1 deletion hippunfold/pipeline_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"GeneratedBy": [
{
"Name": "hippunfold",
"Version": "0.6.10",
"Version": "0.5.0",
"CodeURL": "https://github.com/khanlab/hippunfold",
"Author": "Jordan DeKraker & Ali Khan",
"AuthorEmail": "ali.khan@uwo.ca"
Expand Down
Loading