diff --git a/doc/src/plugins/backend.rst b/doc/src/plugins/backend.rst index fdc93d9..d9ec08b 100644 --- a/doc/src/plugins/backend.rst +++ b/doc/src/plugins/backend.rst @@ -47,15 +47,15 @@ hatchling Select groups to lock ~~~~~~~~~~~~~~~~~~~~~ -By default, the default group and all optional groups will be locked, but you can specify the groups to lock by setting `lock-groups` in the configuration. +By default, the default group and all optional groups will be locked, but you can specify the groups to lock by setting `locked-groups` in the configuration. .. code-block:: toml :caption: pyproject.toml # for pdm-backend [tool.pdm.build] locked = true - lock-groups = ["default", "optional1"] + locked-groups = ["default", "optional1"] # for hatchling [tool.hatch.metadata.hooks.build-locked] - lock-groups = ["default", "optional1"] + locked-groups = ["default", "optional1"] diff --git a/src/pdm_build_locked/backend.py b/src/pdm_build_locked/backend.py index 75fcfa9..05a3bb4 100644 --- a/src/pdm_build_locked/backend.py +++ b/src/pdm_build_locked/backend.py @@ -21,7 +21,7 @@ def pdm_build_hook_enabled(self, context: Context) -> bool: def pdm_build_initialize(self, context: Context) -> None: static_fields = list(context.config.metadata) update_metadata_with_locked( - context.config.metadata, context.root, context.config.build_config.get("lock-groups") + context.config.metadata, context.root, context.config.build_config.get("locked-groups") ) new_fields = set(context.config.metadata) - set(static_fields) for field in new_fields: diff --git a/src/pdm_build_locked/command.py b/src/pdm_build_locked/command.py index 8574fc8..36c9a5a 100644 --- a/src/pdm_build_locked/command.py +++ b/src/pdm_build_locked/command.py @@ -50,7 +50,7 @@ def handle(self, project: Project, options: argparse.Namespace) -> None: if dev_dependencies := project.pyproject.settings.get("dev-dependencies"): pdm_dev_dependencies = dev_dependencies.keys() - groups = project.pyproject.settings.get("build", {}).get("lock-groups", None) + groups = project.pyproject.settings.get("build", {}).get("locked-groups", None) if groups is None: groups = {group for group in project.all_dependencies if group not in pdm_dev_dependencies} else: diff --git a/src/pdm_build_locked/hatchling.py b/src/pdm_build_locked/hatchling.py index b25b28e..60be4a5 100644 --- a/src/pdm_build_locked/hatchling.py +++ b/src/pdm_build_locked/hatchling.py @@ -12,7 +12,7 @@ class BuildLockedMetadataHook(MetadataHookInterface): PLUGIN_NAME = "build-locked" def update(self, metadata: dict) -> None: - update_metadata_with_locked(metadata, Path(self.root), self.config.get("lock-groups")) + update_metadata_with_locked(metadata, Path(self.root), self.config.get("locked-groups")) @hookimpl diff --git a/tests/data/large-selected/pyproject.toml b/tests/data/large-selected/pyproject.toml index 7858314..0f683b4 100644 --- a/tests/data/large-selected/pyproject.toml +++ b/tests/data/large-selected/pyproject.toml @@ -57,7 +57,7 @@ source = "scm" [tool.pdm.build] package-dir = "src" locked = true -lock-groups = ["default"] +locked-groups = ["default"] [tool.pdm.dev-dependencies] dev = [