From 12b6ec6c39b3b51aee60c81324b6f9abfee9d5a6 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 29 Mar 2024 14:09:20 +0000 Subject: [PATCH] fix(project): use absolute github links on PyPi --- pyproject.toml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c6a548ec..c083bcc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "finch-api" version = "0.16.8" description = "The official Python library for the Finch API" -readme = "README.md" +dynamic = ["readme"] license = "Apache-2.0" authors = [ { name = "Finch", email = "founders@tryfinch.com" }, @@ -88,7 +88,7 @@ typecheck = { chain = [ "typecheck:mypy" = "mypy ." [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-fancy-pypi-readme"] build-backend = "hatchling.build" [tool.hatch.build] @@ -99,6 +99,17 @@ include = [ [tool.hatch.build.targets.wheel] packages = ["src/finch"] +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +path = "README.md" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] +# replace relative links with absolute links +pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' +replacement = '[\1](https://github.com/Finch-API/finch-api-python/tree/main/\g<2>)' + [tool.black] line-length = 120 target-version = ["py37"]