Skip to content

Commit fcff13d

Browse files
committed
Rename plugins to nox_task_plugins
1 parent 2357041 commit fcff13d

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

doc/changes/unreleased.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ and replaces them with `format:fix` and `format:check`.
1010
## Feature
1111

1212
* #614: Replaced `path_filters` with `BaseConfig.add_to_excluded_python_paths` and `BaseConfig.excluded_python_paths`
13-
* #626: Moved `plugins` into `BaseConfig`
13+
* #626: Replaced `plugins` with `BaseConfig.nox_task_plugins`

doc/user_guide/customization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ Plugin Registration
6565

6666
Once the plugin class has been defined, it must be registered in the Nox configuration. This is done by adding the class to the `plugins` list within the `Config` data class.
6767

68-
In the Nox `PROJECT_CONFIG`, you should amend the `plugins` list to include the new plugin:
68+
In the Nox `PROJECT_CONFIG`, you should amend the `nox_task_plugins` tuple to include the new plugin:
6969

7070
.. code-block:: python
7171
7272
from exasol.toolbox.config import BaseConfig
7373
7474
PROJECT_CONFIG = BaseConfig(
75-
plugins=(UpdateTemplates,), # register the plugin
75+
nox_task_plugins=(UpdateTemplates,), # register the plugin
7676
)
7777
7878
When Nox runs, it will instantiate `UpdateTemplates` with no arguments and integrate the hooks defined by the plugin into the execution lifecycle. All registered plugins’ hooks are called at their designated points in the Nox workflow.

exasol/toolbox/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class BaseConfig(BaseModel):
9595
`exasol.toolbox.config.DEFAULT_EXCLUDED_PATHS`.
9696
""",
9797
)
98-
plugins: tuple[ValidPluginHook, ...] = Field(
98+
nox_task_plugins: tuple[ValidPluginHook, ...] = Field(
9999
default=(),
100100
description="""
101101
This is used to provide hooks to extend one or more of the Nox tasks provided

exasol/toolbox/nox/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def post_integration_tests_hook(self, session, config, context):
108108
def plugin_manager(config) -> pluggy.PluginManager:
109109
pm = pluggy.PluginManager(_PLUGIN_MARKER)
110110
pm.add_hookspecs(NoxTasks)
111-
for plugin in getattr(config, "plugins", []):
111+
for plugin in getattr(config, "nox_task_plugins", []):
112112
pm.register(plugin())
113113
return pm
114114

noxconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ class Config(BaseConfig):
7171
# The PTB does not have integration tests run with an Exasol DB,
7272
# so for running in the CI, we take the first element.
7373
exasol_versions=(BaseConfig().exasol_versions[0],),
74-
plugins=(UpdateTemplates,),
74+
nox_task_plugins=(UpdateTemplates,),
7575
)

test/unit/config_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@ def prepare_release_update_version(self, session, config, version: Version) -> N
110110
class TestPlugins:
111111
@staticmethod
112112
def test_works_when_empty():
113-
BaseConfig(plugins=())
113+
BaseConfig(nox_task_plugins=())
114114

115115
@staticmethod
116116
def test_works_for_hook(capsys):
117-
BaseConfig(plugins=(WithHook,))
117+
BaseConfig(nox_task_plugins=(WithHook,))
118118

119119
@staticmethod
120120
def test_raises_exception_method_with_hook_not_specified():
121121
with pytest.raises(ValidationError) as ex:
122-
BaseConfig(plugins=(WithNotSpecifiedHook,))
122+
BaseConfig(nox_task_plugins=(WithNotSpecifiedHook,))
123123
assert "Method `not_specified_anywhere`" in str(ex.value)
124124

125125
@staticmethod
126126
def test_raises_exception_without_hook():
127127
with pytest.raises(ValidationError) as ex:
128-
BaseConfig(plugins=(WithoutHook,))
128+
BaseConfig(nox_task_plugins=(WithoutHook,))
129129
assert "No methods in `WithoutHook`" in str(ex.value)

0 commit comments

Comments
 (0)