Skip to content

Fix deprecation warning since conda 26.3 - #1316

Open
lrandersson wants to merge 2 commits into
conda:mainfrom
lrandersson:dev-ra-distro-deprecation
Open

Fix deprecation warning since conda 26.3#1316
lrandersson wants to merge 2 commits into
conda:mainfrom
lrandersson:dev-ra-distro-deprecation

Conversation

@lrandersson

@lrandersson lrandersson commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #1315.

As of right now I only added distro to Linux to mimic the old behavior. However, let me know if we rather add it for all the platforms so I can remove the conditional imports which I'm personally not a big fan of.

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?

@lrandersson lrandersson self-assigned this Aug 6, 2026
@lrandersson
lrandersson marked this pull request as ready for review August 6, 2026 18:10
@lrandersson
lrandersson requested a review from a team as a code owner August 6, 2026 18:10
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 6, 2026
if sys.platform.startswith("linux"):
try:
from conda._vendor import distro # noqa
import distro # noqa

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.

conda has been depending on distro for some time now. Did you verify that this applies to all supported version for constructor? If so, you can remove the try block and remove distro as a conditional dependency.

If not, I suggest

try:
    import distro
except ImportError:
    pass

if not distro:
    try:
        from conda._vendor import distro
    except ImportError:
        pass

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

None yet

Development

Successfully merging this pull request may close these issues.

Fix deprecated conda._vendor.distro import in `conda_interface.py

3 participants