Skip to content
Open
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/hatch/project/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ def prepare_build_environment(self, *, targets: list[str] | None = None, keep_en
except Exception as e: # noqa: BLE001
self.app.abort(f"Environment `{self.build_env.name}` is incompatible: {e}")

self.prepare_environment(self.build_env, keep_env=keep_env)

additional_dependencies: list[str] = []
with self.app.status("Inspecting build dependencies"):
if build_backend != BUILD_BACKEND:
Expand All @@ -290,6 +288,8 @@ def prepare_build_environment(self, *, targets: list[str] | None = None, keep_en
with self.build_env.app_status_dependency_synchronization():
self.build_env.sync_dependencies()

self.prepare_environment(self.build_env, keep_env=keep_env)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be before the context manager that handles dependency synchronization most likely.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I don't think the first if additional_dependencies is necessary still, but I kept it in case of any potential performance benefits (I'm unaware if there actually are any)


def get_dependencies(self) -> tuple[list[str], dict[str, list[str]]]:
dynamic_fields = {"dependencies", "optional-dependencies"}
if not dynamic_fields.intersection(self.metadata.dynamic):
Expand Down
Loading