Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,5 @@ cython_debug/

# Pycharm
.idea/

.vscode
12 changes: 0 additions & 12 deletions .vscode/settings.json

This file was deleted.

12 changes: 8 additions & 4 deletions neurodocker/cli/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import json as json_lib
import sys
import typing as ty
from pathlib import Path
from typing import IO, Any, Optional, Type, cast

Expand All @@ -28,6 +29,9 @@
from neurodocker.reproenv.template import Template
from neurodocker.reproenv.types import allowed_pkg_managers

if ty.TYPE_CHECKING:
from click.parser import ParsingState


class GroupAddCommonParamsAndRegisteredTemplates(click.Group):
"""Subclass of `click.Group` that adds parameters common to `reproenv generate`
Expand Down Expand Up @@ -137,17 +141,17 @@ def __init__(self, *args, **kwargs):
self._eat_all_parser = None

def add_to_parser(self, parser, ctx):
def parser_process(value, state: click.parser.ParsingState):
def parser_process(value, state: ParsingState):
# method to hook to the parser.process
done = False
value = [value]
# grab everything up to the next option
while state.rargs and not done:
while state.rargs and not done: # type: ignore[attr-defined]
for prefix in self._eat_all_parser.prefixes:
if state.rargs[0].startswith(prefix):
if state.rargs[0].startswith(prefix): # type: ignore[attr-defined]
done = True
if not done:
value.append(state.rargs.pop(0))
value.append(state.rargs.pop(0)) # type: ignore[attr-defined]
value = tuple(value)
# call the actual process
self._previous_parser_process(value, state)
Expand Down
1 change: 0 additions & 1 deletion neurodocker/templates/ants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ binaries:
optional:
install_path: /opt/ants-{{ self.version }}
urls:

# Official binaries are provided as of 2.4.1 (https://github.com/ANTsX/ANTs/releases)
2.6.2: https://github.com/ANTsX/ANTs/releases/download/v2.6.2/ants-2.6.2-centos7-X64-gcc.zip
2.6.1: https://github.com/ANTsX/ANTs/releases/download/v2.6.1/ants-2.6.1-centos7-X64-gcc.zip
Expand Down
5 changes: 3 additions & 2 deletions neurodocker/templates/miniconda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name: miniconda
url: https://docs.conda.io/projects/miniconda/en/latest/
binaries:
urls:
latest: https://repo.continuum.io/miniconda/Miniconda3-{{ self.version }}-Linux-x86_64.sh
'*': https://repo.continuum.io/miniconda/Miniconda3-{{ self.version }}-Linux-x86_64.sh
latest: https://repo.continuum.io/miniconda/Miniconda3-{{ self.version }}-Linux-{{ self.arch }}.sh
'*': https://repo.continuum.io/miniconda/Miniconda3-{{ self.version }}-Linux-{{ self.arch }}.sh
Comment on lines +8 to +9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The URLs for latest and * are identical. To improve maintainability and avoid duplication, you can use a YAML anchor.

Additionally, the repo.continuum.io domain redirects to repo.anaconda.com. It's better to use the canonical domain to avoid potential issues if the redirect is removed in the future.

        latest: &miniconda_url https://repo.anaconda.com/miniconda/Miniconda3-{{ self.version }}-Linux-{{ self.arch }}.sh
        '*': *miniconda_url

env:
CONDA_DIR: '{{ self.install_path }}'
PATH: '{{ self.install_path }}/bin:$PATH'
Expand Down Expand Up @@ -34,6 +34,7 @@ binaries:
pip_opts: ''
yaml_file: ''
mamba: 'false'
arch: x86_64
instructions: |
{% if not self.installed.lower() in ["true", "y", "1"] -%}
{{ self.install_dependencies() }}
Expand Down
Loading