Ryujinx-Mako/ryujinx_mako/__main__.py

41 lines
1 KiB
Python
Raw Normal View History

Create a new python package for the current scripts (#1) * infra: Add PR triage action (#5293) This is a bare minimal triage action that handle big categories. In the future we could also label all services correctly but I didn't felt this was required for a first iteration. * infra: Fix PR triage workflow glob patterns (#5297) * Use glob patterns to match file paths * Update ignored paths for releases * Adjust build.yml as well * Add names to auto-assign steps * Fix developer team name * Allow build workflows to run if workflows changed * Fix action version (#5299) * infra: Sync paths-ignore with release job and attempt to fix review assign * infra: Fix PR triage once and for all (#5442) Switch to a custom made python script that query GitHub API to grab latest state of the PR after label assign. * infra: Fix team name in reviewer.yml * infra: do not assign developers team for now Hopefully fix PR triage for real... * Introduce Mako to fix pr_triage workflow (#5574) * pr_triage: Fix invalid workflow * Don't assign reviewers to draft PRs * Add team review request for developers team * Introduce Mako to make team reviewers work * Convert app and installation ids to int (#5587) * infra: add missing quotes around @ developers in reviewers.yml * Adjust README.md and LICENSE * Remove unneeded workflow files * Add basic .editorconfig * Add basic requirements.txt * Add dependabot.yml * Add formatting workflow * Move update_reviewers.py into a new python module * Add reviewers.yml template * Replace requirements.txt with poetry * Fix typo * Add setup-mako action * Add constants to private module * Migrate update_reviewers to subcommand * Add NullHandler for root logger * Add setup-git subcommand * Group all subcommands * Add main script for ryujinx_mako * Create ryujinx-mako command * Add more information to README.md * Apply black formatting * Make PR author check case-insensitive --------- Co-authored-by: Mary <mary@mary.zone> Co-authored-by: ryujinx-mako[bot] <142357924+ryujinx-mako[bot]@users.noreply.github.com>
2023-08-30 17:00:29 +00:00
import argparse
import logging
from ryujinx_mako import commands
2023-09-05 20:19:25 +00:00
from ryujinx_mako._const import SCRIPT_NAME
from ryujinx_mako.commands import Subcommand
Create a new python package for the current scripts (#1) * infra: Add PR triage action (#5293) This is a bare minimal triage action that handle big categories. In the future we could also label all services correctly but I didn't felt this was required for a first iteration. * infra: Fix PR triage workflow glob patterns (#5297) * Use glob patterns to match file paths * Update ignored paths for releases * Adjust build.yml as well * Add names to auto-assign steps * Fix developer team name * Allow build workflows to run if workflows changed * Fix action version (#5299) * infra: Sync paths-ignore with release job and attempt to fix review assign * infra: Fix PR triage once and for all (#5442) Switch to a custom made python script that query GitHub API to grab latest state of the PR after label assign. * infra: Fix team name in reviewer.yml * infra: do not assign developers team for now Hopefully fix PR triage for real... * Introduce Mako to fix pr_triage workflow (#5574) * pr_triage: Fix invalid workflow * Don't assign reviewers to draft PRs * Add team review request for developers team * Introduce Mako to make team reviewers work * Convert app and installation ids to int (#5587) * infra: add missing quotes around @ developers in reviewers.yml * Adjust README.md and LICENSE * Remove unneeded workflow files * Add basic .editorconfig * Add basic requirements.txt * Add dependabot.yml * Add formatting workflow * Move update_reviewers.py into a new python module * Add reviewers.yml template * Replace requirements.txt with poetry * Fix typo * Add setup-mako action * Add constants to private module * Migrate update_reviewers to subcommand * Add NullHandler for root logger * Add setup-git subcommand * Group all subcommands * Add main script for ryujinx_mako * Create ryujinx-mako command * Add more information to README.md * Apply black formatting * Make PR author check case-insensitive --------- Co-authored-by: Mary <mary@mary.zone> Co-authored-by: ryujinx-mako[bot] <142357924+ryujinx-mako[bot]@users.noreply.github.com>
2023-08-30 17:00:29 +00:00
parser = argparse.ArgumentParser(
prog=SCRIPT_NAME,
description="A python module to aid Ryujinx with project management and moderation",
)
subparsers = parser.add_subparsers(
title="subcommands",
required=True,
)
subcommands = []
for subcommand in commands.SUBCOMMANDS:
subcommand_parser = subparsers.add_parser(
subcommand.name(),
description=subcommand.description(),
help=subcommand.description(),
Create a new python package for the current scripts (#1) * infra: Add PR triage action (#5293) This is a bare minimal triage action that handle big categories. In the future we could also label all services correctly but I didn't felt this was required for a first iteration. * infra: Fix PR triage workflow glob patterns (#5297) * Use glob patterns to match file paths * Update ignored paths for releases * Adjust build.yml as well * Add names to auto-assign steps * Fix developer team name * Allow build workflows to run if workflows changed * Fix action version (#5299) * infra: Sync paths-ignore with release job and attempt to fix review assign * infra: Fix PR triage once and for all (#5442) Switch to a custom made python script that query GitHub API to grab latest state of the PR after label assign. * infra: Fix team name in reviewer.yml * infra: do not assign developers team for now Hopefully fix PR triage for real... * Introduce Mako to fix pr_triage workflow (#5574) * pr_triage: Fix invalid workflow * Don't assign reviewers to draft PRs * Add team review request for developers team * Introduce Mako to make team reviewers work * Convert app and installation ids to int (#5587) * infra: add missing quotes around @ developers in reviewers.yml * Adjust README.md and LICENSE * Remove unneeded workflow files * Add basic .editorconfig * Add basic requirements.txt * Add dependabot.yml * Add formatting workflow * Move update_reviewers.py into a new python module * Add reviewers.yml template * Replace requirements.txt with poetry * Fix typo * Add setup-mako action * Add constants to private module * Migrate update_reviewers to subcommand * Add NullHandler for root logger * Add setup-git subcommand * Group all subcommands * Add main script for ryujinx_mako * Create ryujinx-mako command * Add more information to README.md * Apply black formatting * Make PR author check case-insensitive --------- Co-authored-by: Mary <mary@mary.zone> Co-authored-by: ryujinx-mako[bot] <142357924+ryujinx-mako[bot]@users.noreply.github.com>
2023-08-30 17:00:29 +00:00
)
Subcommand.add_subcommand(subcommand.name(), subcommand(subcommand_parser))
Create a new python package for the current scripts (#1) * infra: Add PR triage action (#5293) This is a bare minimal triage action that handle big categories. In the future we could also label all services correctly but I didn't felt this was required for a first iteration. * infra: Fix PR triage workflow glob patterns (#5297) * Use glob patterns to match file paths * Update ignored paths for releases * Adjust build.yml as well * Add names to auto-assign steps * Fix developer team name * Allow build workflows to run if workflows changed * Fix action version (#5299) * infra: Sync paths-ignore with release job and attempt to fix review assign * infra: Fix PR triage once and for all (#5442) Switch to a custom made python script that query GitHub API to grab latest state of the PR after label assign. * infra: Fix team name in reviewer.yml * infra: do not assign developers team for now Hopefully fix PR triage for real... * Introduce Mako to fix pr_triage workflow (#5574) * pr_triage: Fix invalid workflow * Don't assign reviewers to draft PRs * Add team review request for developers team * Introduce Mako to make team reviewers work * Convert app and installation ids to int (#5587) * infra: add missing quotes around @ developers in reviewers.yml * Adjust README.md and LICENSE * Remove unneeded workflow files * Add basic .editorconfig * Add basic requirements.txt * Add dependabot.yml * Add formatting workflow * Move update_reviewers.py into a new python module * Add reviewers.yml template * Replace requirements.txt with poetry * Fix typo * Add setup-mako action * Add constants to private module * Migrate update_reviewers to subcommand * Add NullHandler for root logger * Add setup-git subcommand * Group all subcommands * Add main script for ryujinx_mako * Create ryujinx-mako command * Add more information to README.md * Apply black formatting * Make PR author check case-insensitive --------- Co-authored-by: Mary <mary@mary.zone> Co-authored-by: ryujinx-mako[bot] <142357924+ryujinx-mako[bot]@users.noreply.github.com>
2023-08-30 17:00:29 +00:00
# Keep a reference to the subcommand
subcommands.append(Subcommand.get_subcommand(subcommand.name()))
Create a new python package for the current scripts (#1) * infra: Add PR triage action (#5293) This is a bare minimal triage action that handle big categories. In the future we could also label all services correctly but I didn't felt this was required for a first iteration. * infra: Fix PR triage workflow glob patterns (#5297) * Use glob patterns to match file paths * Update ignored paths for releases * Adjust build.yml as well * Add names to auto-assign steps * Fix developer team name * Allow build workflows to run if workflows changed * Fix action version (#5299) * infra: Sync paths-ignore with release job and attempt to fix review assign * infra: Fix PR triage once and for all (#5442) Switch to a custom made python script that query GitHub API to grab latest state of the PR after label assign. * infra: Fix team name in reviewer.yml * infra: do not assign developers team for now Hopefully fix PR triage for real... * Introduce Mako to fix pr_triage workflow (#5574) * pr_triage: Fix invalid workflow * Don't assign reviewers to draft PRs * Add team review request for developers team * Introduce Mako to make team reviewers work * Convert app and installation ids to int (#5587) * infra: add missing quotes around @ developers in reviewers.yml * Adjust README.md and LICENSE * Remove unneeded workflow files * Add basic .editorconfig * Add basic requirements.txt * Add dependabot.yml * Add formatting workflow * Move update_reviewers.py into a new python module * Add reviewers.yml template * Replace requirements.txt with poetry * Fix typo * Add setup-mako action * Add constants to private module * Migrate update_reviewers to subcommand * Add NullHandler for root logger * Add setup-git subcommand * Group all subcommands * Add main script for ryujinx_mako * Create ryujinx-mako command * Add more information to README.md * Apply black formatting * Make PR author check case-insensitive --------- Co-authored-by: Mary <mary@mary.zone> Co-authored-by: ryujinx-mako[bot] <142357924+ryujinx-mako[bot]@users.noreply.github.com>
2023-08-30 17:00:29 +00:00
def run():
2023-09-05 20:19:25 +00:00
logger = logging.getLogger(SCRIPT_NAME)
Create a new python package for the current scripts (#1) * infra: Add PR triage action (#5293) This is a bare minimal triage action that handle big categories. In the future we could also label all services correctly but I didn't felt this was required for a first iteration. * infra: Fix PR triage workflow glob patterns (#5297) * Use glob patterns to match file paths * Update ignored paths for releases * Adjust build.yml as well * Add names to auto-assign steps * Fix developer team name * Allow build workflows to run if workflows changed * Fix action version (#5299) * infra: Sync paths-ignore with release job and attempt to fix review assign * infra: Fix PR triage once and for all (#5442) Switch to a custom made python script that query GitHub API to grab latest state of the PR after label assign. * infra: Fix team name in reviewer.yml * infra: do not assign developers team for now Hopefully fix PR triage for real... * Introduce Mako to fix pr_triage workflow (#5574) * pr_triage: Fix invalid workflow * Don't assign reviewers to draft PRs * Add team review request for developers team * Introduce Mako to make team reviewers work * Convert app and installation ids to int (#5587) * infra: add missing quotes around @ developers in reviewers.yml * Adjust README.md and LICENSE * Remove unneeded workflow files * Add basic .editorconfig * Add basic requirements.txt * Add dependabot.yml * Add formatting workflow * Move update_reviewers.py into a new python module * Add reviewers.yml template * Replace requirements.txt with poetry * Fix typo * Add setup-mako action * Add constants to private module * Migrate update_reviewers to subcommand * Add NullHandler for root logger * Add setup-git subcommand * Group all subcommands * Add main script for ryujinx_mako * Create ryujinx-mako command * Add more information to README.md * Apply black formatting * Make PR author check case-insensitive --------- Co-authored-by: Mary <mary@mary.zone> Co-authored-by: ryujinx-mako[bot] <142357924+ryujinx-mako[bot]@users.noreply.github.com>
2023-08-30 17:00:29 +00:00
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.INFO)
args = parser.parse_args()
args.func(args)
if __name__ == "__main__":
run()