-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Hatchling build-backend and fix README for PyPI (#1051)
- Loading branch information
Showing
4 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["setuptools>=61.0"] | ||
build-backend = "hatchling.build" | ||
requires = ["hatchling<2", "hatch-fancy-pypi-readme"] | ||
|
||
[project] | ||
name = "pymc-marketing" | ||
description = "Marketing Statistical Models in PyMC" | ||
requires-python = ">=3.10" | ||
readme = "README.md" | ||
license = { file = "LICENSE" } | ||
dynamic = ["version"] | ||
dynamic = ["version", "readme"] | ||
maintainers = [{ name = "PyMC Labs", email = "[email protected]" }] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
|
@@ -80,17 +79,37 @@ test = [ | |
"mlflow>=2.0.0", | ||
] | ||
|
||
[tool.setuptools] | ||
packages = [ | ||
"pymc_marketing", | ||
"pymc_marketing.mmm", | ||
"pymc_marketing.mmm.components", | ||
"pymc_marketing.clv", | ||
"pymc_marketing.clv.models", | ||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
"docs", | ||
] | ||
|
||
[tool.setuptools.dynamic] | ||
version = { file = "pymc_marketing/version.txt" } | ||
[tool.hatch.version] | ||
path = "pymc_marketing/version.py" | ||
|
||
# <https://github.com/hynek/hatch-fancy-pypi-readme> | ||
[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]] | ||
# Image links should go to the raw content on GitHub | ||
# <https://stackoverflow.com/a/46875147> | ||
pattern = '\[(.*?)\]\(((?!https?://)\S+\.(png|jpe?g|svg|gif))\)' | ||
replacement = '[\1](https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/\g<2>)' | ||
|
||
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] | ||
# Handle also HTML image tags | ||
pattern = '''(<img\b[^>]*\bsrc=)(['"])((?!https?://)[^'"]+)(['"][^>]*>)''' | ||
replacement = '<img src="https://raw.githubusercontent.com/pymc-labs/pymc-marketing/main/\g<3>\g<4>' | ||
|
||
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] | ||
# Remaining non-image relative links map to the normal absolute GitHub URL | ||
# <https://stackoverflow.com/a/46875147> | ||
pattern = '\[(.*?)\]\(((?!https?://)\S+)\)' | ||
replacement = '[\1](https://github.com/pymc-labs/pymc-marketing/tree/main/\g<2>)' | ||
|
||
[project.urls] | ||
repository = "https://github.com/pymc-labs/pymc-marketing" | ||
|