From abc3ec5b3c92dbd672f7654f3488d4e1b618d8d5 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 24 Nov 2026 11:15:20 +0100 Subject: [PATCH] Rewrite the Forgejo links instead of GitHub links in the nox session --- noxfile.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/noxfile.py b/noxfile.py index d776578..df675ee 100644 --- a/noxfile.py +++ b/noxfile.py @@ -40,7 +40,7 @@ import nox from nox.sessions import Session -GITHUB_REPOSITORY = 'webartifex/urban-meal-delivery' +FORGEJO_REPOSITORY = 'code.webartifex.de/alexander/velofy' PACKAGE_IMPORT_NAME = 'velofy' # Docs/sphinx locations. @@ -390,7 +390,7 @@ def fix_branch_references(session): # noqa:WPS210 Intended to be run as a pre-commit hook. Many files in the project (e.g., README.md) contain links to resources - on github.com or nbviewer.jupyter.org that contain branch labels. + on Forgejo that contain branch labels. This task rewrites these links such that they contain branch references that make sense given the context: @@ -441,16 +441,9 @@ def fix_branch_references(session): # noqa:WPS210 rewrites = [ { - 'name': 'github', + 'name': 'forgejo', 'pattern': re.compile( - fr'((((http)|(https))://github\.com/{GITHUB_REPOSITORY}/((blob)|(tree))/)([\w\.-]+)/)', # noqa:E501 - ), - 'replacement': fr'\2{branch}/', - }, - { - 'name': 'nbviewer', - 'pattern': re.compile( - fr'((((http)|(https))://nbviewer\.jupyter\.org/github/{GITHUB_REPOSITORY}/((blob)|(tree))/)([\w\.-]+)/)', # noqa:E501 + fr'((https://{FORGEJO_REPOSITORY}/src/branch/)([\w\.-]+)/)', ), 'replacement': fr'\2{branch}/', },