Skip to content
Open
1 change: 1 addition & 0 deletions src/pyosmeta/cli/update_review_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def process_user(
f"Error processing new contributor {gh_user}. Skipping this user.",
exc_info=True,
)
return user, contribs

# Update user the list of contribution types if there are new types to add
# for instance a new reviewer would have a "Reviewer" contributor type
Expand Down
2 changes: 1 addition & 1 deletion src/pyosmeta/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class ReviewModel(BaseModel):
categories: Optional[list[str]] = None
editor: ReviewUser | list[ReviewUser] | None = None
eic: ReviewUser | list[ReviewUser] | None = None
reviewers: list[ReviewUser] = Field(default_factory=list)
reviewers: list[ReviewUser] | None = None
archive: str | None = None
version_accepted: str | None = None
date_accepted: str | None = Field(
Expand Down
6 changes: 4 additions & 2 deletions src/pyosmeta/parse_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _parse_field(self, key: str, val: str) -> Any:
# add other conditions here for special processing of fields..
# pass
else:
return val
return val.strip("*").strip("__") # remove markdown formatting

def parse_issue(self, issue: Issue | str) -> ReviewModel:
"""
Expand Down Expand Up @@ -340,7 +340,7 @@ def parse_issues(

def get_contributor_data(
self, line: str
) -> Union[ReviewUser, List[ReviewUser]]:
) -> Union[ReviewUser, List[ReviewUser], None]:
"""Parse names for various review roles from issue metadata.

Parameters
Expand All @@ -358,6 +358,8 @@ def get_contributor_data(
users = line.split(",")
models = [parse_user_names(username=user) for user in users]
models = [model for model in models if model is not None]
if len(models) == 0:
return None
if len(models) == 1:
models = models[0]
return models
Expand Down
2 changes: 1 addition & 1 deletion src/pyosmeta/utils_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def clean_date(source_date: str | None) -> datetime | str:
def clean_name(source_name: str) -> str:
"""Remove unwanted characters from a name."""

unwanted = ["(", ")", "@"]
unwanted = ["(", ")", "@", "*"]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arguably, not needed anymore since this is stripped during parsing time. it did help earlier but only for the username, not the package name.

Suggested change
unwanted = ["(", ")", "@", "*"]
unwanted = ["(", ")", "@"]

for char in unwanted:
source_name = source_name.replace(char, "")

Expand Down
3 changes: 2 additions & 1 deletion src/pyosmeta/utils_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ def parse_user_names(username: str) -> ReviewUser | None:
"github_username": clean_name(names[0]),
"name": "",
}

if (parsed["github_username"] == "") and (parsed["name"] == ""):
return None
return ReviewUser(**parsed)