From 47d2fcbe8b75c04a0e1795c0e2f4720a71acbb1b Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 29 Sep 2023 23:03:17 -0400 Subject: [PATCH 1/2] replace relative url Signed-off-by: Jinzhe Zeng --- pyproject.toml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a578835fbd..dcfb78835b 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", From e6a36ecd84217f611f541f15ec1ab0a97f9049e4 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sat, 30 Sep 2023 16:25:05 -0400 Subject: [PATCH 2/2] fix regex --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2e8b11b913..17e710aa89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -112,13 +112,13 @@ 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>)' +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>"' +replacement = '\1="https://github.com/deepmodeling/deepmd-kit/raw/master/\g<2>"' [tool.cibuildwheel] test-command = [