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

nuget_dependency: Allow path override #871

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/VariableProducer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
value: ${{ jobs.produce.outputs.node-versions }}

env:
pythonversions: "['3.12', '3.11', '3.10']" # Keep Python Versions in descending order
pythonversions: "['3.12.4', '3.11', '3.10']" # Keep Python Versions in descending order
nodeversions: "['19']"

jobs:
Expand Down
11 changes: 6 additions & 5 deletions edk2toolext/environment/extdeptypes/nuget_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class NugetDependency(ExternalDependency):
def __init__(self, descriptor: dict) -> None:
"""Inits a nuget dependency based off the provided descriptor."""
super().__init__(descriptor)
self.package = descriptor.get("package", self.name)
self.nuget_cache_path = None

@classmethod
Expand Down Expand Up @@ -187,7 +188,7 @@ def _fetch_from_nuget_cache(self, package_name: str) -> bool:
try:
nuget_version = NugetDependency.normalize_version(self.version)
except ValueError:
logging.error(f"NuGet dependency {self.name} has an invalid "
logging.error(f"NuGet dependency {self.package} has an invalid "
f"version string: {self.version}")

cache_search_path = os.path.join(
Expand All @@ -210,15 +211,15 @@ def _fetch_from_nuget_cache(self, package_name: str) -> bool:

def __str__(self) -> str:
"""Return a string representation."""
return f"NugetDependecy: {self.name}@{self.version}"
return f"NugetDependecy: {self.package}@{self.version}"

def _attempt_nuget_install(self, install_dir: str, non_interactive: Optional[bool]=True) -> None:
#
# fetch the contents of the package.
#
package_name = self.name
package_name = self.package
cmd = NugetDependency.GetNugetCmd()
cmd += ["install", self.name]
cmd += ["install", package_name]
cmd += ["-Source", self.source]
cmd += ["-ExcludeVersion"]
if non_interactive:
Expand Down Expand Up @@ -260,7 +261,7 @@ def _attempt_nuget_install(self, install_dir: str, non_interactive: Optional[boo

def fetch(self) -> None:
"""Fetches the dependency using internal state from the init."""
package_name = self.name
package_name = self.package

# First, check the global cache to see if it's present.
if super().fetch():
Expand Down