Skip to content

Normalize pip/conda package-name matching to suppress false MarkupSafe WASM errors#216

Merged
martinRenou merged 3 commits into
mainfrom
copilot/fix-markupsafe-pip-warning
Jun 4, 2026
Merged

Normalize pip/conda package-name matching to suppress false MarkupSafe WASM errors#216
martinRenou merged 3 commits into
mainfrom
copilot/fix-markupsafe-pip-warning

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Pip resolution was treating package names as case-sensitive when checking conda-installed packages, so MarkupSafe requested via pip could be treated as missing even when markupsafe was already present from conda. This produced an incorrect “binary built package not compatible with WASM” warning/error path.

  • Solver behavior: normalize names before conda-installed checks

    • Added package-name normalization in solverpip.ts (PEP 503-style comparison semantics: case-insensitive, -_. treated equivalently).
    • Applied normalization when:
      • building the conda-installed package lookup
      • checking top-level pip requirements
      • checking transitive pip dependencies
    • Result: MarkupSafe, markupsafe, and markup_safe now resolve to the same key for conda skip logic.
  • Regression coverage

    • Added a focused unit test in unittests/tests/pip/test-solver.ts for:
      • conda has markupsafe
      • pip requests MarkupSafe
      • solver skips pip install and logs as already handled by conda
function normalizePackageName(packageName: string): string {
  return packageName.toLowerCase().replace(/[-_.]+/g, '-');
}

Copilot AI changed the title [WIP] Fix pip solver warning for Markupsafe installation Normalize pip/conda package-name matching to suppress false MarkupSafe WASM errors Jun 4, 2026
Copilot AI requested a review from martinRenou June 4, 2026 13:15
@martinRenou martinRenou marked this pull request as ready for review June 4, 2026 13:51

@martinRenou martinRenou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@martinRenou martinRenou merged commit 80d5f65 into main Jun 4, 2026
6 checks passed
@martinRenou martinRenou deleted the copilot/fix-markupsafe-pip-warning branch June 4, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pip install complains about Markupsafe when markupsafe is already installe with conda

2 participants