Skip to content

Commit d8f4ea7

Browse files
committed
Revert
1 parent c162fd5 commit d8f4ea7

File tree

5 files changed

+43
-12
lines changed

5 files changed

+43
-12
lines changed

crates/uv-dev/src/generate_cli_reference.rs

Lines changed: 8 additions & 1 deletion
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_ne!(
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_ne!(*before, after, "Could not find `{value}` in the output");
111+
output = after;
105112
}
106113

107114
output

crates/uv-dev/src/generate_json_schema.rs

Lines changed: 29 additions & 2 deletions
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,32 @@ pub(crate) fn main(args: &Args) -> Result<()> {
8080
Ok(())
8181
}
8282

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

crates/uv-settings/src/settings.rs

Lines changed: 3 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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)