diff --git a/pyproject.toml b/pyproject.toml index 191c96f455..17e710aa89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ backend-path = ["."] [project] name = "deepmd-kit" -dynamic = ["version", "optional-dependencies", "scripts"] +dynamic = ["version", "optional-dependencies", "scripts", "readme"] description = "A deep learning package for many-body potential energy representation and molecular dynamics" authors = [ {name = "DeepModeling"}, @@ -47,7 +47,6 @@ dependencies = [ 'packaging', ] requires-python = ">=3.7" -readme = "README.md" keywords = ["deepmd"] [project.entry-points."lammps.plugins"] @@ -96,12 +95,31 @@ provider-path = "backend" provider = "backend.dynamic_metadata" provider-path = "backend" +[tool.scikit-build.metadata.readme] +provider = "scikit_build_core.metadata.fancy_pypi_readme" + [[tool.scikit-build.generate]] path = "deepmd_cli/_version.py" template = ''' version = "${version}" ''' +[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]] +# links +pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' +replacement = '[\1](https://github.com/deepmodeling/deepmd-kit/tree/master/\g<2>)' + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] +# image +pattern = '(srcset|src)="((?!https?://)\S+?)"' +replacement = '\1="https://github.com/deepmodeling/deepmd-kit/raw/master/\g<2>"' + [tool.cibuildwheel] test-command = [ "python -m deepmd -h",