mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Use local copy of install-wheel-rs
(#34)
This PR modifies the `install-wheel-rs` (and a few other crates) to get everything playing nicely. Specifically, CI should pass, and all these crates now use workspace dependencies between one another. As part of this change, I split out the wheel name parsing into its own `wheel-filename` crate, and the compatibility tag parsing into its own `platform-tags` crate.
This commit is contained in:
parent
e824fe6d2b
commit
ae28552b3a
37 changed files with 516 additions and 1567 deletions
|
@ -12,7 +12,7 @@ license.workspace = true
|
|||
[dependencies]
|
||||
pep440_rs = { path = "../pep440-rs" }
|
||||
pep508_rs = { path = "../pep508-rs" }
|
||||
puffin-platform = { path = "../puffin-platform" }
|
||||
platform-host = { path = "../platform-host" }
|
||||
|
||||
anyhow = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::path::{Path, PathBuf};
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use pep440_rs::Version;
|
||||
use pep508_rs::MarkerEnvironment;
|
||||
|
||||
use puffin_platform::Platform;
|
||||
use platform_host::Platform;
|
||||
|
||||
use crate::python_platform::PythonPlatform;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use std::path::Path;
|
|||
use std::process::{Command, Output};
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
use pep508_rs::MarkerEnvironment;
|
||||
|
||||
/// Return the resolved [`MarkerEnvironment`] for the given Python executable.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use puffin_platform::Platform;
|
||||
use platform_host::{Os, Platform};
|
||||
|
||||
/// A Python-aware wrapper around [`Platform`].
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
|
@ -10,7 +10,7 @@ pub(crate) struct PythonPlatform<'a>(&'a Platform);
|
|||
impl PythonPlatform<'_> {
|
||||
/// Returns the path to the `python` executable inside a virtual environment.
|
||||
pub(crate) fn venv_python(&self, venv_base: impl AsRef<Path>) -> PathBuf {
|
||||
let python = if self.0.is_windows() {
|
||||
let python = if matches!(self.0.os(), Os::Windows) {
|
||||
"python.exe"
|
||||
} else {
|
||||
"python"
|
||||
|
@ -21,7 +21,7 @@ impl PythonPlatform<'_> {
|
|||
/// Returns the directory in which the binaries are stored inside a virtual environment.
|
||||
pub(crate) fn venv_bin_dir(&self, venv_base: impl AsRef<Path>) -> PathBuf {
|
||||
let venv = venv_base.as_ref();
|
||||
if self.0.is_windows() {
|
||||
if matches!(self.0.os(), Os::Windows) {
|
||||
let bin_dir = venv.join("Scripts");
|
||||
if bin_dir.join("python.exe").exists() {
|
||||
return bin_dir;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue