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

## 0.16.2

This release fixes `pexrc inject` target platform detection to handle wheels with compressed tag
sets.

## 0.16.1

This release fixes interpreter detection for `pyenv` shims on unix. Previously the cache of
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 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.16.1"
version = "0.16.2"
edition = { workspace = true }
publish = false

Expand Down
34 changes: 34 additions & 0 deletions python/tests/test_issue_135.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2026 Pex project contributors.
# SPDX-License-Identifier: Apache-2.0

from __future__ import absolute_import

import os.path
import subprocess

import pytest
from testing import IS_WINDOWS, IS_X86_64, pexrc_inject
from testing.interpreter import ensure_python

TYPE_CHECKING = False
if TYPE_CHECKING:
# Ruff doesn't understand Python 2 and thus the type comment usages.
from typing import Any # noqa: F401


@pytest.mark.skipif(
not (IS_WINDOWS and IS_X86_64),
reason=(
"The test requires the pythonnet dependency under test to be consumed as a win-amd64 wheel."
),
)
def test_issue_135(tmpdir):
# type: (Any) -> None

pex = os.path.join(tmpdir, "pex")
subprocess.check_call(
args=["pex", "--platform", "win-amd64-cp-314-cp314", "pythonnet==3.1.0", "-o", pex]
)
injected_pex = pexrc_inject(pex)
python = ensure_python(version=(3, 14))
subprocess.check_call(args=[python, injected_pex, "-c", "import pythonnet"])
18 changes: 13 additions & 5 deletions src/commands/inject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,24 @@ impl<'a> RequiredTargets<'a> {
targets_by_project_name
.entry(wheel.project_name)
.or_insert_with(HashSet::new)
.extend(
wheel
.extend({
let compatible = wheel
.tags
.iter()
.map(|tag| {
.filter_map(|tag| {
SimplifiedTarget::for_platform_tag(tag.platform)
.map(|targets| targets.map(|targets| (wheel.file_name, targets)))
.ok()
})
.collect::<anyhow::Result<Vec<_>>>()?,
);
.collect::<Vec<_>>();
if compatible.is_empty() {
bail!(
"There are no pexrc binaries available that support {wheel}.",
wheel = wheel.file_name
)
}
compatible
});
}
let mut required_targets = IndexSet::new();
for required in targets_by_project_name.values() {
Expand Down