Skip to content

Commit

Permalink
fix(project): use absolute github links on PyPi (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Mar 29, 2024
1 parent b50ed05 commit cbd8b1c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "anthropic"
version = "0.21.3"
description = "The official Python library for the anthropic API"
readme = "README.md"
dynamic = ["readme"]
license = "MIT"
authors = [
{ name = "Anthropic", email = "support@anthropic.com" },
Expand Down Expand Up @@ -90,7 +90,7 @@ typecheck = { chain = [
"typecheck:mypy" = "mypy ."

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"

[tool.hatch.build]
Expand All @@ -101,6 +101,17 @@ include = [
[tool.hatch.build.targets.wheel]
packages = ["src/anthropic"]

[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/anthropics/anthropic-sdk-python/tree/main/\g<2>)'

[tool.black]
line-length = 120
target-version = ["py37"]
Expand Down

0 comments on commit cbd8b1c

Please sign in to comment.