Skip to content

Commit de76a1e

Browse files
committed
add feedstock attributes to FeedstockContext
1 parent fc33822 commit de76a1e

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

conda_forge_tick/auto_tick.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,9 @@ def run(
572572
None means: We don't update the PR data.
573573
"""
574574
if (
575-
isinstance(migrator, MigrationYaml)
576-
and not rerender_info.nontrivial_migration_yaml_changes
577-
and context.attrs["name"] != "conda-forge-pinning"
575+
isinstance(migrator, MigrationYaml)
576+
and not rerender_info.nontrivial_migration_yaml_changes
577+
and context.attrs["name"] != "conda-forge-pinning"
578578
):
579579
# spoof this so it looks like the package is done
580580
pr_data = get_spoofed_closed_pr_info()

conda_forge_tick/contexts.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,18 @@ class ClonedFeedstockContext(FeedstockContext):
117117
# Implementation Note: Keep this class frozen or there will be consistency issues if someone modifies
118118
# a ClonedFeedstockContext object in place - it will not be reflected in the original FeedstockContext object.
119119
local_clone_dir: Path
120+
121+
@property
122+
def git_repo_owner(self) -> str:
123+
return "conda-forge"
124+
125+
@property
126+
def git_repo_name(self) -> str:
127+
return f"{self.feedstock_name}-feedstock"
128+
129+
@property
130+
def git_href(self) -> str:
131+
"""
132+
A link to the feedstocks GitHub repository.
133+
"""
134+
return f"https://github.com/{self.git_repo_owner}/{self.git_repo_name}"

tests/test_contexts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
}
2727
)
2828

29-
3029
def test_feedstock_context_default_branch_not_set():
3130
context = FeedstockContext("TEST-FEEDSTOCK-NAME", demo_attrs)
3231
assert context.default_branch == "main"

0 commit comments

Comments
 (0)