-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/surface_derivatives
- Loading branch information
Showing
81 changed files
with
681 additions
and
349 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
2 changes: 1 addition & 1 deletion
2
.github/Dockerfiles/C-PAC.develop-fMRIPrep-LTS-xenial.Dockerfile
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
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
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,62 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (C) 2024 C-PAC Developers | ||
|
||
# This file is part of C-PAC. | ||
|
||
# C-PAC is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU Lesser General Public License as published by the | ||
# Free Software Foundation, either version 3 of the License, or (at your | ||
# option) any later version. | ||
|
||
# C-PAC is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
# License for more details. | ||
|
||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
# Update version comment strings | ||
cd CPAC | ||
VERSION=$(python -c "from info import __version__; print(('.'.join(('.'.join(__version__[::-1].split('-')[1].split('.')[1:])[::-1], __version__.split('-')[1])) if '-' in __version__ else __version__).split('+', 1)[0])") | ||
cd .. | ||
echo "v${VERSION}" > version | ||
export _SED_COMMAND="s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# Mac OSX | ||
find ./CPAC/resources/configs -name "*.yml" -exec sed -i '' -E "${_SED_COMMAND}" {} \; | ||
else | ||
# Linux and others | ||
find ./CPAC/resources/configs -name "*.yml" -exec sed -i'' -r "${_SED_COMMAND}" {} \; | ||
fi | ||
git add version | ||
VERSIONS=( `git show $(git log --pretty=format:'%h' -n 2 version | tail -n 1):version` `cat version` ) | ||
export PATTERN="(declare|typeset) -a" | ||
if [[ "$(declare -p VERSIONS)" =~ $PATTERN ]] | ||
then | ||
for DOCKERFILE in $(find ./.github/Dockerfiles -name "*.Dockerfile") | ||
do | ||
export IFS="" | ||
for LINE in $(grep "FROM ghcr\.io/fcp\-indi/c\-pac/.*\-${VERSIONS[0]}" ${DOCKERFILE}) | ||
do | ||
echo "Updating stage tags in ${DOCKERFILE}" | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
# Mac OSX | ||
sed -i "" "s/\-${VERSIONS[0]}/\-${VERSIONS[1]}/g" ${DOCKERFILE} | ||
else | ||
# Linux and others | ||
sed -i "s/\-${VERSIONS[0]}/\-${VERSIONS[1]}/g" ${DOCKERFILE} | ||
fi | ||
done | ||
done | ||
unset IFS | ||
fi | ||
git add CPAC/resources/configs .github/Dockerfiles | ||
|
||
# Overwrite top-level Dockerfiles with the CI Dockerfiles | ||
cp .github/Dockerfiles/C-PAC.develop-jammy.Dockerfile Dockerfile | ||
cp .github/Dockerfiles/C-PAC.develop-ABCD-HCP-bionic.Dockerfile variant-ABCD-HCP.Dockerfile | ||
cp .github/Dockerfiles/C-PAC.develop-fMRIPrep-LTS-xenial.Dockerfile variant-fMRIPrep-LTS.Dockerfile | ||
cp .github/Dockerfiles/C-PAC.develop-lite-jammy.Dockerfile variant-lite.Dockerfile | ||
git add *Dockerfile |
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 |
---|---|---|
|
@@ -35,77 +35,8 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
- name: Check if version updated | ||
id: version_updated | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Theodore (Machine User)" | ||
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-) | ||
export PYTHONPATH=$PWD | ||
pip install -q wheel | ||
pip install -q nipype numpy matplotlib pandas pathvalidate pytz pyyaml voluptuous | ||
python ./CPAC/utils/configuration/yaml_template.py | ||
if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]] | ||
then | ||
git add CPAC/resources/configs | ||
git commit -m ":bulb: Update comments based on default preconfig" | ||
fi | ||
COMMIT_MESSAGE=$(git log -1 --pretty=%B) | ||
if [[ ! "$COMMIT_MESSAGE" == *"Update version to"* ]] | ||
then | ||
cd CPAC | ||
VERSION=$(python -c "from info import __version__; print(('.'.join(('.'.join(__version__[::-1].split('-')[1].split('.')[1:])[::-1], __version__.split('-')[1])) if '-' in __version__ else __version__).split('+', 1)[0])") | ||
cd .. | ||
echo "v${VERSION}" > version | ||
find ./CPAC/resources/configs -name "*.yml" -exec sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" {} \; | ||
git add version | ||
VERSIONS=($(git diff origin/${GITHUB_BRANCH} -- version | tail -n 2)) | ||
export PATTERN="(declare|typeset) -a" | ||
if [[ "$(declare -p VERSIONS)" =~ $PATTERN ]] | ||
then | ||
for DOCKERFILE in $(find ./.github/Dockerfiles -name "*.Dockerfile") | ||
do | ||
export IFS="" | ||
for LINE in $(grep "FROM ghcr\.io/fcp\-indi/c\-pac/.*\-${VERSIONS[0]:1}" ${DOCKERFILE}) | ||
do | ||
echo "Updating stage tags in ${DOCKERFILE}" | ||
sed -i "s/\-${VERSIONS[0]:1}/\-${VERSIONS[1]:1}/g" ${DOCKERFILE} | ||
done | ||
done | ||
unset IFS | ||
fi | ||
if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]] | ||
then | ||
git add CPAC/resources/configs .github/Dockerfiles | ||
git commit -m ":bookmark: Update version to ${VERSION} ($COMMIT_MESSAGE)" || true | ||
git push origin HEAD:${GITHUB_BRANCH} || true | ||
fi | ||
cd .. | ||
fi | ||
if [[ "${GITHUB_REF_TYPE}" == "tag" ]] | ||
then | ||
cd $HOME/work/C-PAC/C-PAC | ||
for DOCKERFILE in $(ls .github/Dockerfiles/C-PAC.develop-*.Dockerfile) | ||
do | ||
if [[ "$DOCKERFILE" =~ .*C-PAC.develop-(.*)-(bionic|xenial).Dockerfile ]] | ||
then | ||
cp $DOCKERFILE variant-${BASH_REMATCH[1]}.Dockerfile | ||
else | ||
cp $DOCKERFILE Dockerfile | ||
fi | ||
done | ||
git add *ockerfile | ||
git commit -m ":truck: Copy develop Dockerfiles to root directory \ | ||
\ | ||
[skip ci]" | ||
git push origin HEAD:${GITHUB_BRANCH} || true | ||
fi | ||
- name: Get changed files since last commit | ||
uses: tj-actions/changed-files@v35.7.6 | ||
uses: tj-actions/changed-files@v41.0.0 | ||
id: changed-files | ||
with: | ||
since_last_remote_commit: "true" | ||
|
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,25 @@ | ||
# Copyright (C) 2024 C-PAC Developers | ||
|
||
# This file is part of C-PAC. | ||
|
||
# C-PAC is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU Lesser General Public License as published by the | ||
# Free Software Foundation, either version 3 of the License, or (at your | ||
# option) any later version. | ||
|
||
# C-PAC is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
# License for more details. | ||
|
||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
repos: | ||
- repo: local | ||
hooks: | ||
- id: autoversioning | ||
name: Update Dockerfiles and version comments | ||
entry: .github/scripts/autoversioning.sh | ||
language: script | ||
files: '.*Dockerfile$|.*\.yaml$|^CPAC/info\.py$' |
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
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 |
---|---|---|
@@ -1,37 +1,42 @@ | ||
# Copyright (C) 2022-2024 C-PAC Developers | ||
|
||
# This file is part of C-PAC. | ||
|
||
# C-PAC is free software: you can redistribute it and/or modify it under | ||
# the terms of the GNU Lesser General Public License as published by the | ||
# Free Software Foundation, either version 3 of the License, or (at your | ||
# option) any later version. | ||
|
||
# C-PAC is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
# License for more details. | ||
|
||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with C-PAC. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
Configurable Pipeline for the Analysis of Connectomes | ||
===================================================== | ||
CPAC is a configurable, open-source, Nipype-based, automated processing | ||
pipeline for resting state functional MRI (R-fMRI) data, for use by | ||
both novice and expert users. | ||
""" | ||
|
||
Copyright (C) 2022 C-PAC Developers | ||
This file is part of C-PAC. | ||
from .info import __version__ | ||
version = __version__ | ||
|
||
C-PAC is free software: you can redistribute it and/or modify it under | ||
the terms of the GNU Lesser General Public License as published by the | ||
Free Software Foundation, either version 3 of the License, or (at your | ||
option) any later version. | ||
|
||
C-PAC is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
License for more details. | ||
def _docs_prefix() -> str: | ||
"""Get the docs URL prefix for this version""" | ||
from CPAC.utils.docs import DOCS_URL_PREFIX | ||
return DOCS_URL_PREFIX | ||
|
||
You should have received a copy of the GNU Lesser General Public | ||
License along with C-PAC. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
from .info import __version__ | ||
version = __version__ | ||
_url_version = 'nightly' if __version__.endswith( | ||
'-dev') or __version__.endswith('.dev') else f'v{__version__.lstrip("v")}' | ||
docs_prefix = f'https://fcp-indi.github.io/docs/{_url_version}' | ||
license_notice = f"""Copyright (C) 2022 C-PAC Developers. | ||
license_notice = f"""Copyright (C) 2022-2024 C-PAC Developers. | ||
This program comes with ABSOLUTELY NO WARRANTY. This is free software, | ||
and you are welcome to redistribute it under certain conditions. For | ||
details, see {docs_prefix}/license or the COPYING and | ||
details, see {_docs_prefix()}/license or the COPYING and | ||
COPYING.LESSER files included in the source code.""" | ||
__all__ = ['license_notice', 'version', '__version__'] |
Oops, something went wrong.