From 5231560325d8bc18610eb96d5c060ec7e30ed246 Mon Sep 17 00:00:00 2001 From: James Thomas Date: Sat, 1 Feb 2025 21:42:12 +0000 Subject: [PATCH] Move scripts to .src --- .github/workflows/build.yml | 4 ++-- .github/workflows/notify.yml | 4 ++-- build_readme.py => .src/build_readme.py | 2 +- notify_teams.py => .src/notify_teams.py | 2 +- requirements.txt => .src/requirements.txt | 0 5 files changed, 6 insertions(+), 6 deletions(-) rename build_readme.py => .src/build_readme.py (99%) rename notify_teams.py => .src/notify_teams.py (97%) rename requirements.txt => .src/requirements.txt (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33de25e..7bbc588 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,10 +28,10 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r .src/requirements.txt - name: Update README run: |- - python build_readme.py + python .src/build_readme.py cat README.md - name: Commit and push if README changed run: |- diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 320d185..6816513 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -28,9 +28,9 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r .src/requirements.txt - name: Send adaptive card notification to MS Teams env: TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }} run: |- - python notify_teams.py ${{ github.event.before }} ${{ github.event.after }} + python .src/notify_teams.py ${{ github.event.before }} ${{ github.event.after }} diff --git a/build_readme.py b/.src/build_readme.py similarity index 99% rename from build_readme.py rename to .src/build_readme.py index 6105c92..1fff753 100644 --- a/build_readme.py +++ b/.src/build_readme.py @@ -239,7 +239,7 @@ def get_bookmark(topic: tuple[str]) -> str: if __name__ == "__main__": - repo_path = Path(__file__).parent.resolve() + repo_path = Path(__file__).parent.parent.resolve() times = get_created_times(repo_path) by_topic = get_by_topic(repo_path, times) toc = render_toc(by_topic) diff --git a/notify_teams.py b/.src/notify_teams.py similarity index 97% rename from notify_teams.py rename to .src/notify_teams.py index dbfba23..e20e1d7 100644 --- a/notify_teams.py +++ b/.src/notify_teams.py @@ -121,7 +121,7 @@ def deslugify(slug: str) -> str: if __name__ == "__main__": added_files = get_added_files( - repo_path=Path(__file__).parent, commit1=sys.argv[1], commit2=sys.argv[2] + repo_path=Path(__file__).parent.parent, commit1=sys.argv[1], commit2=sys.argv[2] ) if added_files: payload = prepare_json( diff --git a/requirements.txt b/.src/requirements.txt similarity index 100% rename from requirements.txt rename to .src/requirements.txt