Skip to content

Fix SP_DIR resolving to wrong path for free-threading Python builds - #5990

Draft
jschueller wants to merge 2 commits into
conda:mainfrom
jschueller:issue5563
Draft

Fix SP_DIR resolving to wrong path for free-threading Python builds#5990
jschueller wants to merge 2 commits into
conda:mainfrom
jschueller:issue5563

Conversation

@jschueller

Copy link
Copy Markdown
Contributor
  • Prefer exact python{py_ver} directory match in get_stdlib_dir() before falling back to the glob pattern, so that python3.13t/ is correctly selected when py_ver is "3.13t"
  • Honor is_freethreading variant key in get_py_ver() by appending the "t" suffix to the Python version string when the key is set

Closes #5563

@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review May 27, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label May 27, 2026
@codspeed-hq

codspeed-hq Bot commented May 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing jschueller:issue5563 (6f7340f) with main (a714753)

Open in CodSpeed

@jsmolic jsmolic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, is there any particular reason why this is marked as draft?

We'd need a test to verify the correct behavior before merging.

Are you willing to finish the work in this PR @jschueller?

@jschueller
jschueller marked this pull request as ready for review July 3, 2026 11:41
@jschueller
jschueller requested a review from a team as a code owner July 3, 2026 11:41
Comment thread tests/test_utils.py Outdated

@jsmolic jsmolic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsmolic

jsmolic commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

pre-commit.ci autofix

- Prefer exact python{py_ver} directory match in get_stdlib_dir()
  before falling back to the glob pattern, so that python3.13t/
  is correctly selected when py_ver is "3.13t"
- Honor is_freethreading variant key in get_py_ver() by appending
  the "t" suffix to the Python version string when the key is set

Closes conda#5563
Comment thread conda_build/environ.py
return ".".join(py.split(".")[:2])
ver = ".".join(py.split(".")[:2])
if config.variant.get("is_freethreading", False) and not ver.endswith("t"):
ver += "t"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good change. freethreading doesn't have anything to do with the version. Similar to other options like unicode support (back in 2.x days) and other implementations like pypy, we don't include the ABI in this field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isuruf Do you have any pointers in where should this be fixed in the code?

@jschueller
jschueller marked this pull request as draft July 6, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

SP_DIR vs. freethreading builds: wrong path?

4 participants