Use simpler pip-like Scheme for install paths (#2173)

## Summary

This will make it easier to use the paths returned by `distutils.py`
(for some cases). No code or behavior changes; just removing some fields
we don't need.
This commit is contained in:
Charlie Marsh 2024-03-04 12:50:13 -08:00 committed by GitHub
parent 93f5609476
commit 5fed1f6259
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 66 additions and 93 deletions

View file

@ -2,10 +2,12 @@ pub use base_url::*;
pub use direct_url::*;
pub use lenient_requirement::*;
pub use metadata::*;
pub use scheme::*;
pub use simple_json::*;
mod base_url;
mod direct_url;
mod lenient_requirement;
mod metadata;
mod scheme;
mod simple_json;

View file

@ -0,0 +1,18 @@
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
/// The paths associated with an installation scheme, typically returned by `sysconfig.get_paths()`.
///
/// See: <https://github.com/pypa/pip/blob/ae5fff36b0aad6e5e0037884927eaa29163c0611/src/pip/_internal/models/scheme.py#L12>
///
/// See: <https://docs.python.org/3.12/library/sysconfig.html#installation-paths>
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct Scheme {
pub stdlib: PathBuf,
pub purelib: PathBuf,
pub platlib: PathBuf,
pub scripts: PathBuf,
pub data: PathBuf,
pub include: PathBuf,
}