From 7d0a621be95ccf0f37e889c15f633e7f245a562e Mon Sep 17 00:00:00 2001 From: Tom Close Date: Wed, 20 Mar 2024 07:48:07 +1100 Subject: [PATCH] edited readme --- .github/workflows/fileformats-ci-cd.yaml | 132 ------------------ .../fileformats-extras/README.rst | 15 +- related-packages/fileformats/README.rst | 23 +-- 3 files changed, 15 insertions(+), 155 deletions(-) delete mode 100644 .github/workflows/fileformats-ci-cd.yaml diff --git a/.github/workflows/fileformats-ci-cd.yaml b/.github/workflows/fileformats-ci-cd.yaml deleted file mode 100644 index 58b80a8..0000000 --- a/.github/workflows/fileformats-ci-cd.yaml +++ /dev/null @@ -1,132 +0,0 @@ -name: CI/CD - -on: - push: - branches: [ main, develop ] - pull_request: - branches: [ main, develop ] - release: - types: [published] - -defaults: - run: - shell: bash - -jobs: - test: - strategy: - matrix: - os: [ubuntu-latest] - python-version: ["3.8", "3.12"] - fail-fast: false - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Unset header - # checkout@v2 adds a header that makes branch protection report errors - # because the Github action bot is not a collaborator on the repo - run: git config --local --unset http.https://github.com/.extraheader - - name: Fetch tags - run: git fetch --prune --unshallow - - name: Disable etelemetry - run: echo "NO_ET=TRUE" >> $GITHUB_ENV - - name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Update build tools - run: python3 -m pip install --upgrade pip - - name: Install Package - run: python3 -m pip install -e related-packages/fileformats[test] -e related-packages/fileformats-extras[test] - - name: Pytest - run: pytest -vvs --cov fileformats.medimage_CHANGEME --cov-config .coveragerc --cov-report xml . - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - - build: - needs: [test] - runs-on: ubuntu-latest - strategy: - matrix: - pkg: - - ["main", "related-packages/fileformats"] - - ["extras", "related-packages/fileformats-extras"] - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - - name: Unset header - # checkout@v2 adds a header that makes branch protection report errors - # because the Github action bot is not a collaborator on the repo - run: git config --local --unset http.https://github.com/.extraheader - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.12' - - name: Install build tools - run: python3 -m pip install build twine - - name: Build source and wheel distributions - run: python3 -m build ${{ matrix.pkg[1] }} - - name: Check distributions - run: twine check ${{ matrix.pkg[1] }}/dist/* - - uses: actions/upload-artifact@v3 - with: - name: built-${{ matrix.pkg[0] }} - path: ${{ matrix.pkg[1] }}/dist - - deploy: - needs: [build] - runs-on: ubuntu-latest - steps: - - name: Download build - uses: actions/download-artifact@v3 - with: - name: built-main - path: dist - - name: Check for PyPI token on tag - id: deployable - if: github.event_name == 'release' - env: - PYPI_API_TOKEN: "${{ secrets.FILEFORMATS_PYPI_API_TOKEN }}" - run: if [ -n "$PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi - - name: Upload to PyPI - if: steps.deployable.outputs.DEPLOY - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.FILEFORMATS_PYPI_API_TOKEN }} - - deploy-extras: - needs: [build, deploy] - runs-on: ubuntu-latest - steps: - - name: Download build - uses: actions/download-artifact@v3 - with: - name: built-extras - path: dist - - name: Check for PyPI token on tag - id: deployable - if: github.event_name == 'release' - env: - EXTRAS_PYPI_API_TOKEN: "${{ secrets.FILEFORMATS_EXTRAS_PYPI_API_TOKEN }}" - run: if [ -n "$EXTRAS_PYPI_API_TOKEN" ]; then echo "DEPLOY=true" >> $GITHUB_OUTPUT; fi - - name: Upload to PyPI - if: steps.deployable.outputs.DEPLOY - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.FILEFORMATS_EXTRAS_PYPI_API_TOKEN }} - -# Deploy on tags if PYPI_API_TOKEN is defined in the repository secrets. -# Secrets are not accessible in the if: condition [0], so set an output variable [1] -# [0] https://github.community/t/16928 -# [1] https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-output-parameter diff --git a/related-packages/fileformats-extras/README.rst b/related-packages/fileformats-extras/README.rst index 4e12d62..4aa206c 100644 --- a/related-packages/fileformats-extras/README.rst +++ b/related-packages/fileformats-extras/README.rst @@ -1,12 +1,14 @@ -FileFormats-CHANGEME Extras -====================================== +FileFormats-medimage-CHANGEME Extras +==================================== + .. image:: https://github.com/nipype/pydra-freesurfer/actions/workflows/ci-cd.yaml/badge.svg :target: https://github.com/nipype/pydra-freesurfer/actions/workflows/ci-cd.yaml -This is a extras module for the `fileformats-CHANGEME `__ +This is a extras module for the `fileformats-medimage-CHANGEME `__ fileformats extension package, which provides additional functionality to format classes (i.e. aside -from basic identification and validation), such as conversion tools, metadata parsers, test data generators, etc... +from basic identification and validation), such as conversion tools, metadata parsers, +sample data generators, etc... Quick Installation @@ -14,9 +16,10 @@ Quick Installation This extension can be installed for Python 3 using *pip*:: - $ pip3 install fileformats-CHANGEME-extras + $ pip3 install fileformats-medimage-CHANGEME-extras -This will install the core package and any other dependencies +This will install the package, base packages, and any other dependencies required to +implement the extra functionality. License ------- diff --git a/related-packages/fileformats/README.rst b/related-packages/fileformats/README.rst index 8e4c9b2..1d07e92 100644 --- a/related-packages/fileformats/README.rst +++ b/related-packages/fileformats/README.rst @@ -1,22 +1,11 @@ -How to customise this template -============================== +FileFormats-medimage-CHANGEME +============================= -#. Rename the `related-packages/fileformats/CHANGEME` directory to the name of the fileformats subpackage (e.g. `medimage_fsl`) -#. Search and replace "CHANGEME" with the name of the fileformats subpackage the extras are to be added -#. Replace name + email placeholders in `pyproject.toml` for developers and maintainers -#. Add the extension file-format classes -#. Ensure that all the extension file-format classes are imported into the extras package root, i.e. `fileformats/CHANGEME` -#. Delete these instructions - -... - -FileFormats Extension - CHANGEME -==================================== .. image:: https://github.com/nipype/pydra-CHANGEME/actions/workflows/ci-cd.yml/badge.svg :target: https://github.com/nipype/pydra-CHANGEME/actions/workflows/ci-cd.yml -This is the "CHANGEME" extension module for the -`fileformats `__ package +This is an extension module of the `fileformats `__ +package for defining file formats that are specific to the CHANGME software toolkit. Quick Installation @@ -24,9 +13,9 @@ Quick Installation This extension can be installed for Python 3 using *pip*:: - $ pip3 install fileformats-CHANGEME + $ pip3 install fileformats-medimage-CHANGEME -This will install the core package and any other dependencies +This will install the format extensions and dependent base packages. License -------