Skip to content

Commit

Permalink
feat: update nuget deps
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Jan 18, 2025
1 parent 947b283 commit 58603e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nix_update/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Package:
composer_deps_old: str | None
maven_deps: str | None
mix_deps: str | None
has_nuget_deps: bool
tests: list[str]
has_update_script: bool

Expand Down Expand Up @@ -200,6 +201,7 @@ def eval_expression(
yarn_deps = pkg.yarnOfflineCache.outputHash or null;
yarn_deps_old = pkg.offlineCache.outputHash or null;
maven_deps = pkg.fetchedMavenDeps.outputHash or null;
has_nuget_deps = pkg ? nugetDeps;
mix_deps = pkg.mixFodDeps.outputHash or null;
tests = builtins.attrNames (pkg.passthru.tests or {{}});
has_update_script = {has_update_script};
Expand Down
17 changes: 17 additions & 0 deletions nix_update/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,20 @@ def update_mix_deps_hash(opts: Options, filename: str, current_hash: str) -> Non
replace_hash(filename, current_hash, target_hash)


def update_nuget_deps(opts: Options) -> None:
fetch_deps_script_path = run(
[
"nix-build",
opts.import_path,
"-A",
f"{opts.attribute}.fetch-deps",
"--no-out-link",
]
).stdout.strip()

run([fetch_deps_script_path])


def update_version(
package: Package, version: str, preference: VersionPreference, version_regex: str
) -> bool:
Expand Down Expand Up @@ -557,6 +571,9 @@ def update(opts: Options) -> Package:
if package.mix_deps:
update_mix_deps_hash(opts, package.filename, package.mix_deps)

if package.has_nuget_deps:
update_nuget_deps(opts)

if isinstance(package.cargo_lock, CargoLockInSource | CargoLockInStore):
if opts.generate_lockfile:
generate_lockfile(opts, package.filename, "cargo")
Expand Down

0 comments on commit 58603e3

Please sign in to comment.