Skip to content

Commit

Permalink
setup prototyping env using nf-neuro configs. default to pip if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVCaron committed Dec 11, 2024
1 parent 29b9636 commit 0b01d37
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .devcontainer/prototyping/onCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ echo "source $XDG_CONFIG_HOME/nf-neuro/.env" >> ~/.bashrc
wget -N $NFNEURO_RAW_REPOSITORY/pyproject.toml \
$NFNEURO_RAW_REPOSITORY/poetry.toml \
$NFNEURO_RAW_REPOSITORY/poetry.lock
} || {
echo "Failed to download nf-neuro base project configuration. Creating requirements.txt for pip"
echo "nf-core==$NFCORE_VERSION" > requirements.txt
}

poetry install --no-root
# Try to download VSCode settings from nf-neuro
{
NFNEURO_RAW_REPOSITORY=https://raw.githubusercontent.com/scilus/nf-neuro/main
mkdir -p .vscode
wget -N -P .vscode $NFNEURO_RAW_REPOSITORY/.vscode/settings.json
} || {
echo "Failed to download nf-neuro base project configuration."
echo "Installing nf-core version $NFCORE_VERSION in the current python"
echo "interpreter using pip"
python3 -m pip install nf-core==$NFCORE_VERSION
echo "Could not fetch default extension settings from nf-neuro"
}

# Initial setup for a pipeline prototyping environment
Expand Down
12 changes: 12 additions & 0 deletions .devcontainer/prototyping/updateContentCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ export DEVCONTAINER_CPU_LIMIT=$(grep -c ^processor /proc/cpuinfo)
EOF

unset maxmem
NFCORE_VERSION=2.14.1

if [ -f poetry.lock ] && [ -f pyproject.toml ]
then
poetry install --no-root
elif [ -f requirements.txt ]
then
python3 -m pip install -r requirements.txt
else
echo "No requirements file found, installing nf-core to version $NFCORE_VERSION using pip"
python3 -m pip install nf-core==$NFCORE_VERSION
fi

0 comments on commit 0b01d37

Please sign in to comment.