Skip to content

Commit c569705

Browse files
authored
fix: contrib types aligned with repos (#296)
* fix: contrib types aligned with repos * Fix: uncomment * fix: tests need updated repo names too * fix: token in the token var
1 parent eacfd12 commit c569705

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.github/workflows/test-update-contribs.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
- name: Create Pull Request
3939
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
4040
with:
41+
# Custom token needed to trigger PR checks, as GITHUB_TOKEN won't
42+
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
43+
token: ${{ secrets.PYOS_PR_TOKEN }}
4144
add-paths: |
4245
_data/contributors.yml
4346
_data/packages.yml
@@ -49,7 +52,3 @@ jobs:
4952
title: Update contributor and review data
5053
labels: |
5154
pre-commit.ci autofix
52-
env:
53-
# Custom token needed to trigger PR checks, as GITHUB_TOKEN won't
54-
# https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
55-
GITHUB_TOKEN: ${{ secrets.PYOS_PR_TOKEN }}

src/pyosmeta/contributors.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,28 @@ def check_contrib_type(self, json_file: str):
8383
Contribution type.
8484
"""
8585

86-
if "software-peer-review" in json_file:
86+
if any(
87+
key in json_file
88+
for key in ["software-submission", "software-peer-review"]
89+
):
90+
# TODO: change this to programs - peer review
8791
contrib_type = "peer-review-guide"
88-
elif "python-package-guide" in json_file:
92+
elif any(
93+
key in json_file
94+
for key in [
95+
"python-package-guide",
96+
"pyosPackage",
97+
"pyos-package-template",
98+
]
99+
):
100+
# TODO consider change this to python-packaging
89101
contrib_type = "package-guide"
102+
# TODO: technically packaging guide is open-education too
103+
elif "lessons" in json_file:
104+
contrib_type = "open-education"
90105
elif "pyopensci.github.io" in json_file:
91106
contrib_type = "web-contrib"
92-
elif "update-web-metadata" in json_file:
107+
elif "pyosMeta" in json_file or "metrics" in json_file:
93108
contrib_type = "code-contrib"
94109
else:
95110
contrib_type = "community"

tests/unit/test_contributors_module.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def test_check_contrib_type(process_contributors):
3535
== "web-contrib"
3636
)
3737
assert (
38-
process_contributors.check_contrib_type("update-web-metadata")
39-
== "code-contrib"
38+
process_contributors.check_contrib_type("pyosMeta") == "code-contrib"
4039
)
4140
assert process_contributors.check_contrib_type("other") == "community"
4241

0 commit comments

Comments
 (0)