pydata / pydata/xarray

Please consider moving away from importlib.metadata for version identification

Open
#10,824 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs triage
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What is your issue?

I know there is alot of churn around this, but with some recent refactors we've reintroduced some version checks on xarray (we'll have to remove this because of this).

But i'm looking at a my site-packages directory and i'm noticing that xarray appears twice

xarray-2025.4.0.dist-info/
xarray-2025.9.1.dist-info/
xarray

this is really not due to you all. I've noticed that conda/mamba recently has been leaving many files behind, but it caused me to debug for a while.
https://github.com/pydata/xarray/pull/10771

For me, miniver has been good.

But I just wanted to flag that conda/mamba may be giving your users inaccurate version information

Ultimately, I've just found importlib.metadata to be misleading on the actual code being run. Yes it gives you a picture of the metadata, but that isn't what is actually running given the user's path and all.

I know this change was from 2 years ago.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the current xarray version checks and the changes discussed in pull request #10771, then trace how importlib.metadata reports the installed version. Define an agreed replacement that reflects the code selected by the user's path; done means the approach is implemented and its version behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.