Skip to content

Commit d6724e7

Browse files
committed
Add: partner support to metadata parsing
1 parent 9ebb0bb commit d6724e7

File tree

3 files changed

+10
-24
lines changed

3 files changed

+10
-24
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* Enh: Use `hatch_vcs` for dynamic versioning (@lwasser, #82)
88
* Fix: migrate to pytest for tests and setup hatch scripts (#89, @lwasser)
9+
* Add: Partner support to package (#92, @lwasser)
910

1011
## [v0.15](https://github.com/pyOpenSci/pyosMeta/releases/tag/v0.15)
1112

src/pyosmeta/cli/process_reviews.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
"""
2-
Script that parses metadata from na issue and adds it to a yml file for the
2+
Script that parses metadata from and issue and adds it to a .yml file for the
33
website. It also grabs some of the package metadata such as stars,
44
last commit, etc.
55
6-
Output: packages.yml file containing a list of
6+
Output: packages.yml file containing a list of:
77
1. all packages with accepted reviews
88
2. information related to the review including reviewers, editors
99
3. basic package stats including stars, etc.
10+
4. partner information
1011
1112
To run at the CLI: parse_issue_metadata
1213
"""
@@ -23,8 +24,6 @@
2324

2425
from pyosmeta import ProcessIssues, ReviewModel
2526

26-
# TODO: change the template to ask for date accepted format year-month-day
27-
2827

2928
def main():
3029
process_review = ProcessIssues(
@@ -35,6 +34,10 @@ def main():
3534

3635
# Get all issues for approved packages - load as dict
3736
issues = process_review.return_response()
37+
# TODO: this method parse_issue_header is working but the parsing code is
38+
# really hard to follow
39+
# It is worth another pr that cleans up the workflow around grabbing
40+
# metadata so it's clearer to follow.
3841
accepted_reviews = process_review.parse_issue_header(issues, 45)
3942

4043
# Update gh metrics via api for all packages
@@ -44,6 +47,7 @@ def main():
4447
)
4548

4649
# Populate model objects with review data + metrics
50+
# TODO: all_reviews contains a bunch of extra mess that it doesn't need
4751
final_reviews = {}
4852
for key, review in all_reviews.items():
4953
# First add gh meta to each dict

src/pyosmeta/parse_issues.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class ReviewModel(BaseModel):
167167
closed_at: Optional[str] = None
168168
issue_link: str = None
169169
joss: Optional[str] = None
170+
partners: Optional[list[str]] = None
170171
gh_meta: Optional[GhMeta] = None
171172

172173
@field_validator(
@@ -458,26 +459,6 @@ def parse_issue_header(
458459
and not key.startswith("-_[x]_i_agree")
459460
}
460461
review[pkg_name] = review_clean
461-
# filtered = {}
462-
# for key, value in review.items():
463-
# print(key)
464-
# if not key.startswith("##") and not key.startswith("-"):
465-
# filtered[key] = value
466-
467-
# # Clean markdown url's from editor, and reviewer lines
468-
# TODO - this could be a reviewer name cleanup validaotr
469-
# types = ["editor", "reviewer_1", "reviewer_2"]
470-
# user_values = ["github_username", "name"]
471-
# for a_type in types:
472-
# for user_value in user_values:
473-
# issue_meta[a_type][user_value] = (
474-
# issue_meta[a_type][user_value]
475-
# .replace("https://github.com/", "")
476-
# .replace("[", "")
477-
# .replace("]", "")
478-
# )
479-
480-
# review[pkg_name] = issue_meta
481462

482463
return review
483464

0 commit comments

Comments
 (0)