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
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release Notes

## 0.16.0

This release fixes interpreter discovery for Windows. The [PEP-514 spec](
https://peps.python.org/pep-0514/) is now implemented while also searching further on the
`PEX_PYTHON_PATH` or `PATH` as appropriate.

In addition, the new `pexrc python {list,inspect}` tools allow insight into the `pexrc` interpreter
discovery mechanism.

## 0.15.0

This release adds defaults for Linux and Windows for the `platform_release` environment marker when
Expand Down
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cargo-features = ["profile-rustflags"]

[package]
name = "pexrc"
version = "0.15.0"
version = "0.16.0"
edition = { workspace = true }
publish = false

Expand Down Expand Up @@ -210,6 +210,7 @@ url = "2.5"
# does not have a feature to activate the dep.
version-ranges = "*"
walkdir = "2.5"
windows-registry = "0.6"
which = "8.0"
xz2 = "0.1"
zip = { version = "8.6", default-features = false, features = ["chrono", "deflate", "zstd"] }
Expand Down Expand Up @@ -253,6 +254,7 @@ python-proxy = { path = "crates/python-proxy" }
rayon = { workspace = true }
request = { path = "crates/request" }
scripts = { path = "crates/scripts", features = ["embedded"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
strum = { workspace = true }
target = { path = "crates/target" }
Expand Down
25 changes: 15 additions & 10 deletions crates/boot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use interpreter::{
SearchPath,
SelectionStrategy,
VersionSpec,
calculate_compatible_unix_binary_names,
};
use itertools::Itertools;
use pex::{Pex, PexPath};
Expand Down Expand Up @@ -63,16 +64,20 @@ pub fn sh_boot_shebang(
.interpreter_selection_strategy
.unwrap_or(pex::InterpreterSelectionStrategy::Oldest)
.into();
let pythons = interpreter_constraints
.calculate_compatible_binary_names(selection_strategy, preferred_interpreter)
.into_iter()
.map(|(binary_name, version_spec)| {
binary_name
.into_string()
.map(|binary_name| (binary_name, version_spec))
.map_err(|err| anyhow!("{err}", err = err.display()))
})
.collect::<anyhow::Result<Vec<_>>>()?;
let pythons = calculate_compatible_unix_binary_names(
&interpreter_constraints,
selection_strategy,
preferred_interpreter,
true,
)
.into_iter()
.map(|(binary_name, version_spec)| {
binary_name
.into_string()
.map(|binary_name| (binary_name, version_spec))
.map_err(|err| anyhow!("{err}", err = err.display()))
})
.collect::<anyhow::Result<Vec<_>>>()?;
let python_args = if hermetic {
if pythons.iter().any(|(_, version_spec)| {
matches!(version_spec, None | Some(VersionSpec::Major(_)))
Expand Down
6 changes: 3 additions & 3 deletions crates/build-system/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::downloads::ensure_download;
use crate::metadata::{Build, CargoBinstall, Download, Embeds, Glibc};

pub(crate) struct ToolBox<'a> {
emeds: Embeds<'a>,
embeds: Embeds<'a>,
binstall: CargoBinstall<'a>,
zig_version: &'a str,
glibc: Glibc<'a>,
Expand All @@ -40,7 +40,7 @@ impl<'a> From<Build<'a>> for ToolBox<'a> {
let downloads: Vec<(&'static str, Download<'a>)> = Vec::new();

Self {
emeds: build.embeds,
embeds: build.embeds,
binstall: build.cargo_binstall,
zig_version: build.zig_version,
glibc: build.glibc,
Expand Down Expand Up @@ -77,7 +77,7 @@ impl<'a> ToolBox<'a> {
}
}
Ok(ToolInventory {
embeds: self.emeds,
embeds: self.embeds,
binstall: self.binstall,
downloads: self.downloads,
zig,
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use serde_json::ser::PrettyFormatter;
#[derive(Args)]
pub struct Json {
/// Pretty-print json output with the given indent.
#[arg(short = 'i', long)]
#[arg(short = 'i', long, help_heading = "Output")]
indent: Option<u8>,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use fs_err::File;
#[derive(Args)]
pub struct Output {
/// A file to send output to; STDOUT by default.
#[arg(short = 'o', long)]
#[arg(short = 'o', long, help_heading = "Output")]
output: Option<PathBuf>,
}

Expand Down
3 changes: 3 additions & 0 deletions crates/interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ time = { workspace = true }
url = { workspace = true }
which = { workspace = true }

[target.'cfg(windows)'.dependencies]
windows-registry = { workspace = true }

[dev-dependencies]
anyhow = { workspace = true }
pep440_rs = { workspace = true }
Expand Down
Loading