Skip to content

Commit

Permalink
refactor: Add missing "provides" for consistency
Browse files Browse the repository at this point in the history
These provides are not necessary for dependecy resolving.
But upcoming caching will reuse the provides and therefore require
consistent use of it.
  • Loading branch information
Melkor333 committed Apr 19, 2024
1 parent 7551c83 commit 4cda30c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions pyaptly/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def publish_cmd_update(cfg, publish_name, publish_config, ignore_existing=False)

if "repo" in publish_config:
publish_cmd.append("update")
return command.Command(publish_cmd + options + args)
cmd = command.Command(publish_cmd + options + args)
cmd.provide("publish", publish_name)
return cmd

publish_fullname = "%s %s" % (publish_name, publish_config["distribution"])
current_snapshots = state_reader.state_reader().publish_map()[publish_fullname]
Expand Down Expand Up @@ -141,7 +143,9 @@ def publish_cmd_update(cfg, publish_name, publish_config, ignore_existing=False)
if "skip-contents" in publish_config and publish_config["skip-contents"]:
options.append("-skip-contents=true")

return command.Command(publish_cmd + options + args + new_snapshots)
cmd = command.Command(publish_cmd + options + args + new_snapshots)
cmd.provide("publish", publish_fullname)
return cmd


def publish_cmd_create(cfg, publish_name, publish_config, ignore_existing=False):
Expand Down Expand Up @@ -256,4 +260,6 @@ def publish_cmd_create(cfg, publish_name, publish_config, ignore_existing=False)
assert has_source
assert len(components) == num_sources

return command.Command(publish_cmd + options + source_args + endpoint_args)
cmd = command.Command(publish_cmd + options + source_args + endpoint_args)
cmd.provide("publish", publish_fullname)
return cmd
5 changes: 4 additions & 1 deletion pyaptly/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ def repo_cmd_create(cfg, repo_name, repo_config):
)
)

return command.Command(repo_cmd + options + endpoint_args)

cmd = command.Command(repo_cmd + options + endpoint_args)
cmd.provide("repo", repo_name)
return cmd

0 comments on commit 4cda30c

Please sign in to comment.