Skip to main content

uv_test/packse/
mod.rs

1//! Local mock index for packse scenario tests.
2//!
3//! This module provides a [`PackseServer`] that reads packse scenario TOML definitions
4//! and serves a PEP 691 Simple API + wheel/sdist downloads via a local wiremock server.
5//! Each test gets its own server instance, so package names need no prefix mangling.
6
7pub mod scenario;
8mod server;
9mod wheel;
10
11use std::path::{Path, PathBuf};
12
13pub use server::PackseServer;
14
15fn workspace_root() -> PathBuf {
16    Path::new(env!("CARGO_MANIFEST_DIR"))
17        .parent()
18        .and_then(Path::parent)
19        .map(Path::to_path_buf)
20        .expect("CARGO_MANIFEST_DIR should be nested under workspace root")
21}
22
23/// Base directory containing the vendored packse scenario TOML files.
24fn scenarios_dir() -> PathBuf {
25    workspace_root().join("test").join("scenarios")
26}