Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Update build targets & add hatch-fancy-pypi-readme #588

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
---
hide:
- navigation
---

# Release Notes

## Latest Changes

Expand Down Expand Up @@ -197,6 +191,8 @@ hide:
!!! warning
This is a beta release. Please do not use in production.

<!-- package description limit -->

### Major Changes 🚑️

* ➖ Remove Documentation Workflow. PR [#414](https://github.com/yezz123/authx/pull/414) by [@yezz123](https://github.com/yezz123).
Expand Down
32 changes: 30 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-fancy-pypi-readme>=22.5.0"]
build-backend = "hatchling.build"

[project]
Expand Down Expand Up @@ -64,11 +64,39 @@ allow-direct-references = true
Homepage = "https://github.com/yezz123/authx"
Documentation = "https://authx.yezz.me/"
Funding = 'https://github.com/sponsors/yezz123'

Source = 'https://github.com/yezz123/authx'
Changelog = 'https://authx.yezz.me/release/'

[tool.hatch.version]
path = "authx/__init__.py"

[tool.hatch.build.targets.sdist]
# limit which files are included in the sdist (.tar.gz) asset,
# to exclude unnecessary files and directories from the distribution
include = [
'/README.md',
'/docs/release.md',
'/scripts',
'/authx',
'/tests',
'/requirements',
]

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = 'text/markdown'
# construct the PyPI readme from README.md and HISTORY.md
fragments = [
{path = "README.md"},
{text = "\n## Changelog\n\n"},
{path = "docs/release.md", pattern = "(.+?)<!-- package description limit -->"},
{text = "\n... see [here](https://authx.yezz.me/release/#100b0) for earlier changes.\n"},
]
# convert GitHuB issue/PR numbers and handles to links
substitutions = [
{pattern = '(\s+)#(\d+)', replacement = '\1[#\2](https://github.com/yezz123/authx/issues/\2)'},
{pattern = '(\s+)@([\w\-]+)', replacement = '\1[@\2](https://github.com/\2)'},
{pattern = '@@', replacement = '@'},
]

[tool.ruff.lint]
mccabe = { max-complexity = 14 }
Expand Down
Loading