Generate a README for crate members too (#16812)

We skip members with existing READMEs for now.

Follows #16809 and #16811
This commit is contained in:
Zanie Blue 2025-11-21 15:44:05 -06:00 committed by GitHub
parent ba46a448d4
commit 7b8240dca9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 675 additions and 66 deletions

10
crates/uv-auth/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-auth
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-bench/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-bench
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-bin-install
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-build-backend
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-build-frontend
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-cache-info
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-cache-key
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-cache/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-cache
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-cli/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-cli
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-client
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-configuration
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-console
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-dev/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-dev
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-dirs/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-dirs
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-dispatch
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-distribution-filename
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-distribution-types
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-distribution
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-extract
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-flags/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-flags
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-fs/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-fs
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-git-types
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-git/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-git
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-install-wheel
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-installer
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-logging
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-macros
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-metadata
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-normalize
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-once-map
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-options-metadata
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-performance-memory-allocator
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-platform-tags
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-platform
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-preview
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-publish
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-pypi-types
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-python
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-redacted
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-requirements-txt
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-requirements
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-resolver
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-scripts
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-settings
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-shell/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-shell
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-small-str
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-state/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-state
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-static
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-tool/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-tool
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-torch/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-torch
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-trampoline-builder
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

10
crates/uv-types/README.md Normal file
View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-types
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-version
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-warnings
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -0,0 +1,10 @@
<!-- This file is generated. DO NOT EDIT -->
# uv-workspace
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's
[crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning)
for details on versioning.

View File

@ -1,3 +1,5 @@
<!-- This file is generated. DO NOT EDIT -->
# uv
uv is a Python package and project manager.

View File

@ -0,0 +1,123 @@
# /// script
# requires-python = ">=3.13"
# dependencies = []
# ///
import json
import pathlib
import subprocess
GENERATED_HEADER = "<!-- This file is generated. DO NOT EDIT -->"
UV_TEMPLATE = """
{GENERATED_HEADER}
# uv
uv is a Python package and project manager.
See the [documentation](https://docs.astral.sh/uv/) or [repository](https://github.com/astral-sh/uv)
for more information.
This crate is the entry point to the uv command-line interface. The Rust API exposed here is not
considered public interface.
The following uv workspace members are also available:
{WORKSPACE_MEMBERS}
uv's workspace members are considered internal and will have frequent breaking changes.
See uv's [crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning) for details on versioning.
"""
MEMBER_TEMPLATE = """
{GENERATED_HEADER}
# {name}
This crate is an internal component of [uv](https://crates.io/uv). The Rust API exposed here is
unstable and will have frequent breaking changes.
See uv's [crate versioning
policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning) for details on
versioning.
"""
def main() -> None:
result = subprocess.run(
["cargo", "metadata", "--format-version", "1"],
capture_output=True,
text=True,
check=True,
)
content = json.loads(result.stdout)
packages = {package["id"]: package for package in content["packages"]}
workspace_root = pathlib.Path(content["workspace_root"])
readme_path = workspace_root / "crates" / "uv" / "README.md"
workspace_members = []
for workspace_member in content["workspace_members"]:
name = packages[workspace_member]["name"]
if name != "uv":
workspace_members.append(name)
workspace_members.sort()
members_list = "\n".join(
f"- [{name}](https://crates.io/crates/{name})" for name in workspace_members
)
# Generate README for the main uv crate
readme_content = UV_TEMPLATE.format(
GENERATED_HEADER=GENERATED_HEADER, WORKSPACE_MEMBERS=members_list
)
readme_path.write_text(readme_content)
# Track all generated README paths for formatting at the end
generated_paths = [readme_path]
# Generate READMEs for all workspace members
for workspace_member in content["workspace_members"]:
package = packages[workspace_member]
name = package["name"]
# Skip the main uv crate (already handled above)
if name == "uv":
continue
# Determine the README path for this crate
manifest_path = pathlib.Path(package["manifest_path"])
crate_dir = manifest_path.parent
member_readme_path = crate_dir / "README.md"
# Check if README already exists
if member_readme_path.exists():
existing_content = member_readme_path.read_text()
# Skip if it doesn't have the generated header
if not existing_content.startswith(GENERATED_HEADER):
print(f"Skipping {name}: existing README without generated header")
continue
# Generate the README content
member_readme_content = MEMBER_TEMPLATE.format(
GENERATED_HEADER=GENERATED_HEADER, name=name
)
member_readme_path.write_text(member_readme_content)
generated_paths.append(member_readme_path)
print(f"Generated README for {name}")
# Format all generated READMEs once at the end
subprocess.run(
["npx", "prettier", "--write", "--prose-wrap", "always"]
+ [str(path) for path in generated_paths],
check=True,
)
if __name__ == "__main__":
main()

View File

@ -1,66 +0,0 @@
# /// script
# requires-python = ">=3.13"
# dependencies = []
# ///
import json
import pathlib
import subprocess
TEMPLATE = """# uv
uv is a Python package and project manager.
See the [documentation](https://docs.astral.sh/uv/) or [repository](https://github.com/astral-sh/uv)
for more information.
This crate is the entry point to the uv command-line interface. The Rust API exposed here is not
considered public interface.
The following uv workspace members are also available:
{WORKSPACE_MEMBERS}
uv's workspace members are considered internal and will have frequent breaking changes.
See uv's [crate versioning policy](https://docs.astral.sh/uv/reference/policies/versioning/#crate-versioning) for details on versioning.
"""
def main() -> None:
result = subprocess.run(
["cargo", "metadata", "--format-version", "1"],
capture_output=True,
text=True,
check=True,
)
content = json.loads(result.stdout)
packages = {package["id"]: package for package in content["packages"]}
workspace_root = pathlib.Path(content["workspace_root"])
readme_path = workspace_root / "crates" / "uv" / "README.md"
workspace_members = []
for workspace_member in content["workspace_members"]:
name = packages[workspace_member]["name"]
if name != "uv":
workspace_members.append(name)
workspace_members.sort()
members_list = "\n".join(
f"- [{name}](https://crates.io/crates/{name})" for name in workspace_members
)
readme_content = TEMPLATE.format(WORKSPACE_MEMBERS=members_list)
readme_path.write_text(readme_content)
subprocess.run(
["npx", "prettier", "--write", "--prose-wrap", "always", str(readme_path)],
check=True,
)
if __name__ == "__main__":
main()