From 420ecb20beb468f8a7b46a6f7161ad40693fce36 Mon Sep 17 00:00:00 2001 From: Vaikunthan Mathiyalakan Date: Tue, 13 Aug 2024 10:41:35 -0400 Subject: [PATCH] bootstrap configs --- .github/workflows/ci.yml | 4 +- Dockerfile | 8 +-- README.md | 107 ++++++++------------------------------- setup.py | 12 ++--- 4 files changed, 31 insertions(+), 100 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 966e0c5..cb25c93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ on: jobs: test: name: Unit tests - if: false # delete this line to enable automatic testing runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -41,8 +40,7 @@ jobs: build: name: Build - if: false # delete this line and uncomment the line below to enable automatic builds - # if: github.event_name == 'push' || github.event_name == 'release' + if: github.event_name == 'push' || github.event_name == 'release' # needs: [ test ] # uncomment to require passing tests runs-on: ubuntu-22.04 diff --git a/Dockerfile b/Dockerfile index b3fd92b..a0780fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,10 @@ FROM docker.io/python:3.12.1-slim-bookworm LABEL org.opencontainers.image.authors="FNNDSC " \ - org.opencontainers.image.title="ChRIS Plugin Title" \ - org.opencontainers.image.description="A ChRIS plugin that..." + org.opencontainers.image.title="Datetree" \ + org.opencontainers.image.description="A file directory script that takes in a date range and output directory and creates a nested dir structure" -ARG SRCDIR=/usr/local/src/app +ARG SRCDIR=/usr/local/src/Documents WORKDIR ${SRCDIR} COPY requirements.txt . @@ -19,4 +19,4 @@ RUN pip install ".[${extras_require}]" \ && cd / && rm -rf ${SRCDIR} WORKDIR / -CMD ["commandname"] +CMD ["datetree"] diff --git a/README.md b/README.md index a8ff3ec..aa6c546 100644 --- a/README.md +++ b/README.md @@ -1,76 +1,10 @@ -# _ChRIS_ Plugin Template +# Datetree -[![test status](https://github.com/FNNDSC/python-chrisapp-template/actions/workflows/src.yml/badge.svg)](https://github.com/FNNDSC/python-chrisapp-template/actions/workflows/src.yml) -[![MIT License](https://img.shields.io/github/license/FNNDSC/python-chrisapp-template)](LICENSE) +[![Version](https://img.shields.io/docker/v/fnndsc/Documents?sort=semver)](https://hub.docker.com/r/fnndsc/Documents) +[![MIT License](https://img.shields.io/github/license/fnndsc/Documents)](https://github.com/FNNDSC/Documents/blob/main/LICENSE) +[![ci](https://github.com/FNNDSC/Documents/actions/workflows/ci.yml/badge.svg)](https://github.com/FNNDSC/Documents/actions/workflows/ci.yml) -This is a minimal template repository for _ChRIS_ plugin applications in Python. - -## About _ChRIS_ Plugins - -A _ChRIS_ plugin is a scientific data-processing software which can run anywhere all-the-same: -in the cloud via a [web app](https://github.com/FNNDSC/ChRIS_ui/), or on your own laptop -from the terminal. They are easy to build and easy to understand: most simply, a -_ChRIS_ plugin is a command-line program which processes data from an input directory -and creates data to an output directory with the usage -`commandname [options...] inputdir/ outputdir/`. - -For more information, visit our website https://chrisproject.org - -## How to Use This Template - -Go to https://github.com/FNNDSC/python-chrisapp-template and click "Use this template". -The newly created repository is ready to use right away. - -A script `bootstrap.sh` is provided to help fill in and rename values for your new project. -It is optional to use. - -1. Edit the variables in `bootstrap.sh` -2. Run `./bootstrap.sh` -3. Follow the instructions it will print out - -## Example Plugins - -Here are some good, complete examples of _ChRIS_ plugins created from this template. - -- https://github.com/FNNDSC/pl-dcm2niix (basic command wrapper example) -- (parallelizes a command) -- https://github.com/FNNDSC/pl-mri-preview (uses [NiBabel](https://nipy.org/nibabel/)) -- https://github.com/FNNDSC/pl-pyvista-volume (example using Python package project structure and pytest) -- https://github.com/FNNDSC/pl-fetal-cp-surface-extract (has a good README.md) - -## What's Inside - -| Path | Purpose | -|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `app.py` | Main script: start editing here! | -| `tests/` | Unit tests | -| `setup.py` | [Python project metadata and installation script](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#setup-py) | -| `requirements.txt` | List of Python dependencies | -| `Dockerfile` | [Container image build recipe](https://docs.docker.com/engine/reference/builder/) | -| `.github/workflows/ci.yml` | "continuous integration" using [Github Actions](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions): automatic testing, building, and uploads to https://chrisstore.co | - -## Contributing - -The source code for the `main` branch of this repository is on the -[src](https://github.com/fnndsc/python-chrisapp-template/tree/src) -branch, which has an additional file -[`.github/workflows/src.yml`](https://github.com/FNNDSC/python-chrisapp-template/blob/src/.github/workflows/src.yml) -When tests pass, changes are automatically merged into `main`. -Developers should commit to or make pull requests targeting `src`. -Do not push directly to `main`. - -This is a workaround in order to do automatic testing of this template -without including the `.github/workflows/src.yml` file in the template itself. - - diff --git a/setup.py b/setup.py index 240b0dd..c98e570 100644 --- a/setup.py +++ b/setup.py @@ -19,18 +19,18 @@ def get_version(rel_path: str) -> str: setup( - name='chris-plugin-template', - version=get_version('app.py'), - description='A ChRIS DS plugin template', + name='Documents', + version=get_version('datetree.py'), + description='A file directory script that takes in a date range and output directory and creates a nested dir structure', author='FNNDSC', author_email='dev@babyMRI.org', - url='https://github.com/FNNDSC/python-chrisapp-template', - py_modules=['app'], + url='https://github.com/FNNDSC/pl-datetree', + py_modules=['datetree'], install_requires=['chris_plugin'], license='MIT', entry_points={ 'console_scripts': [ - 'commandname = app:main' + 'datetree = datetree:main' ] }, classifiers=[