Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- container configs: use correct key for conda configs ([#4269](https://github.com/nf-core/tools/pull/4269))
- Coerce launch params_out to Path to fix AttributeError (#4299) ([#4317](https://github.com/nf-core/tools/pull/4317))
- generate valid Markdown when piping schema docs to file ([#4319](https://github.com/nf-core/tools/pull/4319))
- fix API docs bug in pydantic autodoc ([#4320](https://github.com/nf-core/tools/pull/4320))

### Linting

Expand Down
1 change: 1 addition & 0 deletions docs/api/_src/api/nf_core_yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ container-registry:
:model-show-validator-members: false
:model-show-field-summary: true
:field-show-alias: true
:no-index:
```
2 changes: 1 addition & 1 deletion docs/api/_src/api/pipelines/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See the [Lint Tests](/docs/nf-core-tools/api_reference/dev/pipeline_lint_tests)
```

```{eval-rst}
.. autoclass:: nf_core.lint.PipelineLint
.. autoclass:: nf_core.pipelines.lint.PipelineLint
:members: _lint_pipeline
:private-members: _print_results, _get_results_md, _save_json_results, _wrap_quotes
:show-inheritance:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# nf_core.pipelines.utils

```{eval-rst}
.. automodule:: nf_core.pipelines.utils
.. automodule:: nf_core.pipelines.lint_utils
:members:
:undoc-members:
:show-inheritance:
Expand Down
8 changes: 5 additions & 3 deletions nf_core/pipelines/create/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any

import yaml
from pydantic import ConfigDict, ValidationError, ValidationInfo, field_validator
from pydantic import ValidationError, ValidationInfo, field_validator
from textual import on
from textual.app import ComposeResult
from textual.containers import Grid, HorizontalScroll
Expand All @@ -18,6 +18,10 @@
import nf_core
from nf_core.utils import NFCoreTemplateConfig

# Sphinx/autodoc triggers Pydantic model rebuilds which require `Dict` in this module's namespace.
# Using the builtin dict (not typing.Dict) because Pydantic v2 only accepts the lowercase form.
Dict = dict

# Use ContextVar to define a context on the model initialization
_init_context_var: ContextVar = ContextVar("_init_context_var", default=None)

Expand All @@ -41,8 +45,6 @@ def init_context(value: dict[str, Any]) -> Iterator[None]:
class CreateConfig(NFCoreTemplateConfig):
"""Pydantic model for the nf-core create config."""

model_config = ConfigDict(extra="allow")

def __init__(self, /, **data: Any) -> None:
"""Custom init method to allow using a context on the model initialization."""
context = _init_context_var.get()
Expand Down