From dc4eaf7cbb7f333177480e05f8ef662d42c1f2c2 Mon Sep 17 00:00:00 2001 From: Helge Date: Fri, 15 Nov 2024 11:22:01 +0000 Subject: [PATCH] Housekeeping for the scripts (#413) Cleanup: - Removed pointless reversed when creating issue list (it is sorted afterwards) - Removed create_topic as no longer needed see https://codeberg.org/fediverse/fep/issues/274 - Made scripts executable Reviewed-on: https://codeberg.org/fediverse/fep/pulls/413 Reviewed-by: silverpill Co-authored-by: Helge Co-committed-by: Helge --- scripts/README.md | 15 ++------------- scripts/create_issue.py | 2 ++ scripts/create_readme.py | 2 +- scripts/create_topic.py | 36 ------------------------------------ scripts/tools/__init__.py | 1 - 5 files changed, 5 insertions(+), 51 deletions(-) mode change 100644 => 100755 scripts/create_issue.py delete mode 100644 scripts/create_topic.py diff --git a/scripts/README.md b/scripts/README.md index 70370cb..1fc9ad6 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -8,31 +8,20 @@ Merge the Pull Request in [https://codeberg.org/fediverse/fep/pulls](https://cod and note the slug. ```bash -python scripts/create_issue.py $SLUG +./scripts/create_issue.py $SLUG ``` creates the tracking issue and updates the FEP with the information. Then run ```bash -python scripts/create_readme.py +./scripts/create_readme.py ``` to update the table in `README.md`. You are now ready to commit the changes to the FEP (added `trackingIssue` to frontmatter) and README.md, added the new FEP. -Run - -```bash -python scripts/create_topic.py $SLUG -``` - -and following the instructions to create a topic on SocialHub to discuss -the FEP. - -Finally, add the link to the SocialHub topic to the tracking issue, created above. - ## Configuration Add a file `config.json` to the directory `scripts` with content diff --git a/scripts/create_issue.py b/scripts/create_issue.py old mode 100644 new mode 100755 index 67b89fb..f8841f3 --- a/scripts/create_issue.py +++ b/scripts/create_issue.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + from argparse import ArgumentParser from datetime import date, timedelta from tools import FepFile diff --git a/scripts/create_readme.py b/scripts/create_readme.py index de3bbc5..6347bc1 100755 --- a/scripts/create_readme.py +++ b/scripts/create_readme.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python from tools import Readme diff --git a/scripts/create_topic.py b/scripts/create_topic.py deleted file mode 100644 index 245b38c..0000000 --- a/scripts/create_topic.py +++ /dev/null @@ -1,36 +0,0 @@ -from argparse import ArgumentParser -from tools import FepFile - -parser = ArgumentParser("Create topic for FEP") -parser.add_argument("fep", help="slug of the FEP") -args = parser.parse_args() - -fep_file = FepFile(args.fep) - -fep_file.write() - -url = f"https://codeberg.org/fediverse/fep/src/branch/main/fep/{args.fep}/fep-{args.fep}.md" - - -body = f""" -Hello! - -This is a discussion thread for the proposed [FEP-{args.fep}: {fep_file.title}]({url}). -Please use this thread to discuss the proposed FEP and any potential problems -or improvements that can be addressed. - -__Summary__ - -{fep_file.summary} -""" - -print("Create a new topic on https://socialhub.activitypub.rocks/c/standards/fep/54") -print("with title") -print(f" FEP-{args.fep}: {fep_file.title}") -print("and tags") -print(f" fep, fep-{args.fep}, draft") -print("and body") -print(body) -print("") -discussionsTo = fep_file.parsed_frontmatter["discussionsTo"] -print(f"After creating the issue add a link to the tracking issue {discussionsTo}") diff --git a/scripts/tools/__init__.py b/scripts/tools/__init__.py index 2300eb3..7a08a95 100644 --- a/scripts/tools/__init__.py +++ b/scripts/tools/__init__.py @@ -36,7 +36,6 @@ class Readme: @property def table(self): fep_files = [FepFile(fep) for fep in get_fep_ids()] - fep_files = reversed(fep_files) fep_files = sorted( fep_files, key=lambda x: (x.parsed_frontmatter["dateReceived"], x.parsed_frontmatter["slug"]),