Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash-normalize PrefixRecord.files for conda list #14523

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jaimergp
Copy link
Contributor

@jaimergp jaimergp commented Jan 29, 2025

Description

Fixes conda-forge/conda-forge-ci-setup-feedstock#362

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@jaimergp jaimergp requested a review from a team as a code owner January 29, 2025 00:13
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 29, 2025
Copy link

codspeed-hq bot commented Jan 29, 2025

CodSpeed Performance Report

Merging #14523 will not alter performance

Comparing jaimergp:read-normalize-files (38a96ad) with main (c46fcee)

Summary

✅ 21 untouched benchmarks

Comment on lines +441 to +446
anchor_paths = []
for fpath in prefix_record.files:
if on_win:
fpath = fpath.replace("\\", "/")
if matcher(fpath):
anchor_paths.append(fpath)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could fix this earlier in the PrefixRecord instantiation, but then we would pay for this conversion every time we load any record. However we only need this fix for conda list, which is the only one that uses PrefixData with pip_interop_enabled=True. This function in only called in that code path.

@jaimergp
Copy link
Contributor Author

@conda/conda-maintainers, ready for review.

Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

This doesn't have an issue assigned, please open one for record keeping (and user discovery).

On the specific change, this looks a little weird as a fix to work around a behavior that only happens when used with micromamba. I do think that in case another conda-like system uses the same files internally, it should follow conda's pattern of encoding data, like file paths.

I haven't done the research why this uses forward slashes, and why micromamba doesn't. But either way, this smells like something to fix in the path actions, instead of just superficially when running conda list.

@jezdez
Copy link
Member

jezdez commented Feb 3, 2025

Oh, also, this kind of needs tests it seems?

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: 🏗️ In Progress
Development

Successfully merging this pull request may close these issues.

conda list misidentifies source channel for Python packages installed in environments created with micromamba
4 participants