Skip to content

Validate package names against CEP-26 naming conventions - #5977

Open
jezdez wants to merge 1 commit into
mainfrom
fix/cep26-package-name-validation
Open

Validate package names against CEP-26 naming conventions#5977
jezdez wants to merge 1 commit into
mainfrom
fix/cep26-package-name-validation

Conversation

@jezdez

@jezdez jezdez commented May 15, 2026

Copy link
Copy Markdown
Member

Description

Validates package/name in recipes against CEP-26 naming conventions, matching the validation recently added to conda's MatchSpec parser (conda/conda#16096).

Adds a check_package_name() function with the CEP-26 distributable and virtual package name regexes. This replaces the generic check_bad_chrs() call for package/name (which only checked a hardcoded set of special characters) with proper structural validation:

  • Distributable names: must start with [a-z0-9] or single _, use only [a-z0-9._-], no consecutive separators
  • Virtual names: must start with __, followed by valid name characters

check_bad_chrs() continues to serve package/version and build/string fields unchanged.

Closes #5976.

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? (not applicable)

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

codspeed-hq Bot commented May 15, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks


Comparing fix/cep26-package-name-validation (aa6bdc2) with main (7e89757)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (100f46a) during the generation of this report, so 7e89757 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@jezdez
jezdez marked this pull request as ready for review July 22, 2026 09:24
@jezdez
jezdez requested a review from a team as a code owner July 22, 2026 09:24
Add check_package_name() that validates package/name against
the CEP-26 distributable and virtual package name regexes,
replacing the generic check_bad_chrs() call for package names.
@jezdez
jezdez force-pushed the fix/cep26-package-name-validation branch from 312526e to aa6bdc2 Compare July 22, 2026 09:25
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.

Assure that conda-build respects CEP 26 package naming conventions

2 participants