Skip to content

Commit

Permalink
[#6335] fix(python-client): Fix pypi document link error (#6342)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Correct the Gravitino document link from
`https://datastrato.ai/docs/latest` to
`https://gravitino.apache.org/docs/$gravitinoVersion`, suppose the
publish version is `0.8.0-incubating`, the link will start with
`https://gravitino.apache.org/docs/0.8.0-incubating`

### Why are the changes needed?

Fix: #6335 

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?

run `./gradlew :clients:client-python:distribution -x test` and check
`README`
  • Loading branch information
FANNG1 authored and web-flow committed Jan 22, 2025
1 parent 58f8808 commit bb99b83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clients/client-python/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ fun generatePypiProjectHomePage() {
// relative path of the images in the how-to-use-python-client.md file is incorrect. We need
// to fix the relative path of the images/markdown to the absolute path.
val content = outputFile.readText()
val docsUrl = "https://datastrato.ai/docs/latest"
val docsUrl = "https://gravitino.apache.org/docs/latest"

// Use regular expression to match the `[](./a/b/c.md?language=python)` or `[](./a/b/c.md#arg1)` link in the content
// Convert `[](./a/b/c.md?language=python)` to `[](https://datastrato.ai/docs/latest/a/b/c/language=python)`
// Convert `[](./a/b/c.md?language=python)` to `[](https://gravitino.apache.org/docs/latest/a/b/c/language=python)`
val patternDocs = Regex("""(?<!!)\[([^\]]+)]\(\.\/([^)]+)\.md([?#][^)]+)?\)""")
val contentUpdateDocs = patternDocs.replace(content) { matchResult ->
val text = matchResult.groupValues[1]
Expand Down

0 comments on commit bb99b83

Please sign in to comment.