Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/sync-python-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Sync Python Releases
run: |
uv run -- fetch-download-metadata.py
uv run -- minify-download-metadata.py
working-directory: ./crates/uv-python
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions crates/uv-python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
download-metadata-minified.json
3 changes: 3 additions & 0 deletions crates/uv-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ itertools = { version = "0.14.0" }
temp-env = { version = "0.3.6" }
tempfile = { workspace = true }
test-log = { version = "0.2.16", features = ["trace"], default-features = false }

[build-dependencies]
serde_json = { workspace = true }
41 changes: 41 additions & 0 deletions crates/uv-python/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
use std::fs;
use std::path::Path;

fn process_json(data: &serde_json::Value) -> serde_json::Value {
let mut out_data = serde_json::Map::new();

if let Some(obj) = data.as_object() {
for (key, value) in obj {
if let Some(variant) = value.get("variant") {
// Exclude debug variants for now, we don't support them
if variant == "debug" {
continue;
}
}

out_data.insert(key.clone(), value.clone());
}
}

serde_json::Value::Object(out_data)
}

fn main() {
let version_metadata = Path::new("download-metadata.json");
let target = Path::new("src/download-metadata-minified.json");

let json_data: serde_json::Value = serde_json::from_str(
#[allow(clippy::disallowed_methods)]
&fs::read_to_string(version_metadata).expect("Failed to read download-metadata.json"),
)
.expect("Failed to parse JSON");

let filtered_data = process_json(&json_data);

#[allow(clippy::disallowed_methods)]
fs::write(
target,
serde_json::to_string(&filtered_data).expect("Failed to serialize JSON"),
)
.expect("Failed to write minified JSON");
}
43 changes: 0 additions & 43 deletions crates/uv-python/minify-download-metadata.py

This file was deleted.

1 change: 0 additions & 1 deletion crates/uv-python/src/download-metadata-minified.json

This file was deleted.

Loading