Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling version bumps for path dependencies when using UvPyprojectHandler #303

Merged
Merged
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
Prev Previous commit
Next Next commit
mute mypy complaints
Ghelfi committed Jan 28, 2025
commit 3736de10546ec705c8fdc1cbf4f1490f636bea2a
12 changes: 6 additions & 6 deletions kraken-build/src/kraken/std/python/buildsystem/uv.py
Original file line number Diff line number Diff line change
@@ -196,18 +196,18 @@ def get_packages(self) -> list[PyprojectHandler.Package]:
package_name = self.raw["project"]["name"]
return [self.Package(include=package_name.replace("-", "_").replace(".", "_"))]

def _get_sources(self) -> dict[str, dict]:
return self.raw.get("tool", {}).get("uv", {}).get("sources", {})
def _get_sources(self) -> dict[str, dict[str, Any]]:
return self.raw.get("tool", {}).get("uv", {}).get("sources", {}) # type: ignore [no-any-return]

def _get_dependencies(self) -> list[str]:
"""Fetches dependencies following [PEP631](https://peps.python.org/pep-0631/) format."""
return self.raw.get("project", {}).get("dependencies", [])
return self.raw.get("project", {}).get("dependencies", []) # type: ignore [no-any-return]

def _get_dependency_groups(self) -> dict[str, list[str]]:
return self.raw.get("project", {}).get("dependency-groups", {})
return self.raw.get("project", {}).get("dependency-groups", {}) # type: ignore [no-any-return]

def _get_optional_dependencies(self) -> dict[str, list[str]]:
return self.raw.get("project", {}).get("optional-dependencies", {})
return self.raw.get("project", {}).get("optional-dependencies", {}) # type: ignore [no-any-return]

def set_path_dependencies_to_version(self, version: str) -> None:
"""
@@ -221,7 +221,7 @@ def set_path_dependencies_to_version(self, version: str) -> None:

# TODO(Ghelfi): Add Test

sources: dict[str, dict] = self._get_sources()
sources = self._get_sources()
dependencies = self._get_dependencies()
dependency_groups = self._get_dependency_groups()
optional_dependencies = self._get_optional_dependencies()