diff --git a/README.md b/README.md index 13fa502..e048249 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,8 @@ The optional `ensured-targets` is a list of expected file paths after building a "standard" version sdist or wheel. The optional `skip-if-exists` is a list of paths whose presence would cause -the build step to be skipped. +the build step to be skipped. This option is ignored in `editable` mode. +The `ensured-targets` will still be checked, if given. The optional `build-kwargs` is a set of keyword arguments to pass to the build function. diff --git a/hatch_jupyter_builder/plugin.py b/hatch_jupyter_builder/plugin.py index d5c05c7..9334f09 100644 --- a/hatch_jupyter_builder/plugin.py +++ b/hatch_jupyter_builder/plugin.py @@ -28,20 +28,21 @@ def initialize(self, version, build_data): ensured_targets = self.config.get("ensured-targets", []) skip_if_exists = self.config.get("skip-if-exists", []) + if version == "editable": + build_kwargs = editable_build_kwargs or build_kwargs + + should_skip_build = False if not build_function: - return + should_skip_build = True - if skip_if_exists: - return should_skip(skip_if_exists) + elif skip_if_exists and version == "standard": + should_skip_build = should_skip(skip_if_exists) # Get build function and call it with normalized parameter names. - build_func = get_build_func(build_function) - - if version == "editable": - build_kwargs = editable_build_kwargs or build_kwargs - - build_kwargs = normalize_kwargs(build_kwargs) - build_func(self.target_name, version, **build_kwargs) + if not should_skip_build: + build_func = get_build_func(build_function) + build_kwargs = normalize_kwargs(build_kwargs) + build_func(self.target_name, version, **build_kwargs) # Ensure targets in distributable dists. if version == "standard":