Skip to content

Commit 59610b1

Browse files
committed
Revert
1 parent c162fd5 commit 59610b1

File tree

5 files changed

+41
-12
lines changed

5 files changed

+41
-12
lines changed

crates/uv-dev/src/generate_cli_reference.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ fn generate() -> String {
101101
generate_command(&mut output, &uv, &mut parents);
102102

103103
for (value, replacement) in REPLACEMENTS {
104-
output = output.replace(value, replacement);
104+
assert!(
105+
value != replacement,
106+
"`value` and `replacement` must be different, but both are `{value}`"
107+
);
108+
let before = &output;
109+
let after = output.replace(value, replacement);
110+
assert!(*before != after, "Could not find `{value}` in the output");
111+
output = after;
105112
}
106113

107114
output

crates/uv-dev/src/generate_json_schema.rs

+27-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub(crate) struct Args {
3333
}
3434

3535
pub(crate) fn main(args: &Args) -> Result<()> {
36-
let schema = schema_for!(CombinedOptions);
37-
let schema_string = serde_json::to_string_pretty(&schema).unwrap();
36+
// Generate the schema.
37+
let schema_string = generate();
3838
let filename = "uv.schema.json";
3939
let schema_path = PathBuf::from(ROOT_DIR).join(filename);
4040

@@ -80,5 +80,30 @@ pub(crate) fn main(args: &Args) -> Result<()> {
8080
Ok(())
8181
}
8282

83+
/// Generate the JSON schema for the combined options as a string.
84+
fn generate() -> String {
85+
let schema = schema_for!(CombinedOptions);
86+
let mut output = serde_json::to_string_pretty(&schema).unwrap();
87+
88+
for (value, replacement) in [
89+
// Use the fully-resolved URL rather than the relative Markdown path.
90+
(
91+
"(../concepts/dependencies.md)",
92+
"(https://docs.astral.sh/uv/concepts/dependencies/)",
93+
),
94+
] {
95+
assert!(
96+
value != replacement,
97+
"`value` and `replacement` must be different, but both are `{value}`"
98+
);
99+
let before = &output;
100+
let after = output.replace(value, replacement);
101+
assert!(*before != after, "Could not find `{value}` in the output");
102+
output = after;
103+
}
104+
105+
output
106+
}
107+
83108
#[cfg(test)]
84109
mod tests;

crates/uv-settings/src/settings.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ pub struct Options {
8686
cache_keys: Option<Vec<CacheKey>>,
8787

8888
// NOTE(charlie): These fields are shared with `ToolUv` in
89-
// `crates/uv-workspace/src/pyproject.rs`. The documentation lives on that struct.
90-
// They're respected in both `pyproject.toml` and `uv.toml` files.
89+
// `crates/uv-workspace/src/pyproject.rs`, and the documentation lives on that struct.
9190
#[cfg_attr(feature = "schemars", schemars(skip))]
9291
pub override_dependencies: Option<Vec<Requirement<VerbatimParsedUrl>>>,
9392

@@ -1552,15 +1551,13 @@ pub struct OptionsWire {
15521551
cache_keys: Option<Vec<CacheKey>>,
15531552

15541553
// NOTE(charlie): These fields are shared with `ToolUv` in
1555-
// `crates/uv-workspace/src/pyproject.rs`. The documentation lives on that struct.
1556-
// They're respected in both `pyproject.toml` and `uv.toml` files.
1554+
// `crates/uv-workspace/src/pyproject.rs`, and the documentation lives on that struct.
15571555
override_dependencies: Option<Vec<Requirement<VerbatimParsedUrl>>>,
15581556
constraint_dependencies: Option<Vec<Requirement<VerbatimParsedUrl>>>,
15591557
environments: Option<SupportedEnvironments>,
15601558

15611559
// NOTE(charlie): These fields should be kept in-sync with `ToolUv` in
1562-
// `crates/uv-workspace/src/pyproject.rs`. The documentation lives on that struct.
1563-
// They're only respected in `pyproject.toml` files, and should be rejected in `uv.toml` files.
1560+
// `crates/uv-workspace/src/pyproject.rs`.
15641561
#[allow(dead_code)]
15651562
workspace: Option<serde::de::IgnoredAny>,
15661563
#[allow(dead_code)]

crates/uv-workspace/src/pyproject.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub struct ToolUv {
158158
/// during development. A dependency source can be a Git repository, a URL, a local path, or an
159159
/// alternative registry.
160160
///
161-
/// See [Dependencies](https://docs.astral.sh/uv/concepts/dependencies/) for more.
161+
/// See [Dependencies](../concepts/dependencies.md) for more.
162162
#[option(
163163
default = "\"[]\"",
164164
value_type = "dict",

docs/reference/settings.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ The sources to use when resolving dependencies.
206206
during development. A dependency source can be a Git repository, a URL, a local path, or an
207207
alternative registry.
208208

209-
See [Dependencies](https://docs.astral.sh/uv/concepts/dependencies/) for more.
209+
See [Dependencies](../concepts/dependencies.md) for more.
210210

211211
**Default value**: `"[]"`
212212

@@ -215,7 +215,7 @@ See [Dependencies](https://docs.astral.sh/uv/concepts/dependencies/) for more.
215215
**Example usage**:
216216

217217
```toml title="pyproject.toml"
218-
[tool.uv]
218+
219219
[tool.uv.sources]
220220
httpx = { git = "https://github.com/encode/httpx", tag = "0.27.0" }
221221
pytest = { url = "https://files.pythonhosted.org/packages/6b/77/7440a06a8ead44c7757a64362dd22df5760f9b12dc5f11b6188cd2fc27a0/pytest-8.3.3-py3-none-any.whl" }

0 commit comments

Comments
 (0)