Skip to content

Commit

Permalink
Merge pull request #3189 from mashehu/sync-modules
Browse files Browse the repository at this point in the history
add API docs for .nf-core.yml
  • Loading branch information
mashehu authored Oct 4, 2024
2 parents 38db8cb + fa1a01d commit bb2b10d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/api/_src/api/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# nf_core.utils

```{eval-rst}
.. automodule:: nf_core.utils
:members:
:undoc-members:
:show-inheritance:
:private-members:
```
2 changes: 1 addition & 1 deletion docs/api/_src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["myst_parser", "sphinx.ext.autodoc", "sphinx.ext.napoleon"]
extensions = ["myst_parser", "sphinx.ext.autodoc", "sphinx.ext.napoleon", "sphinxcontrib.autodoc_pydantic"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["./_templates"]
Expand Down
1 change: 1 addition & 0 deletions docs/api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
autodoc_pydantic
Sphinx>=3.3.1
sphinxcontrib-napoleon
sphinx-markdown-builder
Expand Down
2 changes: 1 addition & 1 deletion nf_core/modules/modules_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def move_component_to_local(self, component_type: str, component: str, repo_name
to_name += f"-{datetime.datetime.now().strftime('%y%m%d%H%M%S')}"
shutil.move(str(current_path), local_dir / to_name)

def unsynced_components(self) -> Tuple[List[str], List[str], dict]:
def unsynced_components(self) -> Tuple[List[str], List[str], Dict]:
"""
Compute the difference between the modules/subworkflows in the directory and the
modules/subworkflows in the 'modules.json' file. This is done by looking at all
Expand Down
20 changes: 20 additions & 0 deletions nf_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,15 +1050,26 @@ def get_repo_releases_branches(pipeline, wfs):


class NFCoreTemplateConfig(BaseModel):
"""Template configuration schema"""

org: Optional[str] = None
""" Organisation name """
name: Optional[str] = None
""" Pipeline name """
description: Optional[str] = None
""" Pipeline description """
author: Optional[str] = None
""" Pipeline author """
version: Optional[str] = None
""" Pipeline version """
force: Optional[bool] = True
""" Force overwrite of existing files """
outdir: Optional[Union[str, Path]] = None
""" Output directory """
skip_features: Optional[list] = None
""" Skip features. See https://nf-co.re/docs/nf-core-tools/pipelines/create for a list of features. """
is_nfcore: Optional[bool] = None
""" Whether the pipeline is an nf-core pipeline. """

# convert outdir to str
@field_validator("outdir")
Expand All @@ -1081,13 +1092,22 @@ def get(self, item: str, default: Any = None) -> Any:


class NFCoreYamlConfig(BaseModel):
""".nf-core.yml configuration file schema"""

repository_type: str
""" Type of repository: pipeline or modules """
nf_core_version: Optional[str] = None
""" Version of nf-core/tools used to create/update the pipeline"""
org_path: Optional[str] = None
""" Path to the organisation's modules repository (used for modules repo_type only) """
lint: Optional[LintConfigType] = None
""" Pipeline linting configuration, see https://nf-co.re/docs/nf-core-tools/pipelines/lint#linting-config for examples and documentation """
template: Optional[NFCoreTemplateConfig] = None
""" Pipeline template configuration """
bump_version: Optional[Dict[str, bool]] = None
""" Disable bumping of the version for a module/subworkflow (when repository_type is modules). See https://nf-co.re/docs/nf-core-tools/modules/bump-versions for more information."""
update: Optional[Dict[str, Union[str, bool, Dict[str, Union[str, Dict[str, Union[str, bool]]]]]]] = None
""" Disable updating specific modules/subworkflows (when repository_type is pipeline). See https://nf-co.re/docs/nf-core-tools/modules/update for more information."""

def __getitem__(self, item: str) -> Any:
return getattr(self, item)
Expand Down

0 comments on commit bb2b10d

Please sign in to comment.