Skip to content

Commit 1b285ec

Browse files
committed
Separate GitHub concerns from repo_info function.
Ref #5
1 parent f4996b1 commit 1b285ec

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

discovery.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ def none_as(replacement):
7474

7575
@functools.lru_cache
7676
@jaraco.functools.apply(none_as({}))
77-
@suppress(subprocess.CalledProcessError)
7877
def repo_info() -> Mapping:
78+
return github_repo_info()
79+
80+
81+
@suppress(subprocess.CalledProcessError)
82+
def github_repo_info() -> Mapping:
7983
data = json.loads(
8084
subprocess.check_output(
8185
['gh', 'repo', 'view', '--json', 'description,url'],
@@ -86,19 +90,19 @@ def repo_info() -> Mapping:
8690
return {k: v for k, v in data.items() if v}
8791

8892

89-
def summary_from_github():
93+
def summary():
9094
"""
91-
Load the summary from GitHub.
95+
Load the summary from hosted project.
9296
93-
>>> summary_from_github()
97+
>>> summary()
9498
'A zero-config Python project build backend'
9599
"""
96100
return repo_info().get('description')
97101

98102

99103
def source_url():
100104
"""
101-
Load the repo URL from GitHub.
105+
Load the repo URL from hosted project.
102106
103107
>>> source_url()
104108
'https://github.com/coherent-oss/coherent.build'

metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def _discover_fields():
8989
yield 'Name', discovery.best_name()
9090
yield 'Version', discovery.version_from_vcs()
9191
yield 'Author-Email', discovery.author_from_vcs()
92-
yield 'Summary', discovery.summary_from_github()
92+
yield 'Summary', discovery.summary()
9393
yield 'Requires-Python', discovery.python_requires_supported()
9494
deps = list(discovery.combined_deps())
9595
for dep in deps:

0 commit comments

Comments
 (0)