feat: support branches and URLs for --ansible-core-version#409
Merged
cidrblock merged 5 commits intoansible:mainfrom Feb 24, 2026
Merged
feat: support branches and URLs for --ansible-core-version#409cidrblock merged 5 commits intoansible:mainfrom
cidrblock merged 5 commits intoansible:mainfrom
Conversation
Allow `--acv` to accept GitHub branch names (e.g. `devel`, `milestone`, `stable-2.16`) and direct URLs in addition to PyPI version numbers. This enables tox-ansible to delegate collection installation to ade, using branch-based ansible-core builds from the ansible GitHub repository. Co-authored-by: Cursor <[email protected]>
Use packaging.version.Version for PEP 440 detection so pre-release versions like 2.19.0rc1 are correctly recognized as PyPI versions instead of being treated as branch names. Fall back to a leading-digit heuristic when packaging is unavailable. Quote the resolved package with shlex.quote before interpolating it into the shell command string to prevent injection or breakage from metacharacters. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Cursor <[email protected]>
Narrow the no-packaging fallback from r"^\d" to r"^\d+\.\d+" so strings like "2devel" are consistently treated as branch names regardless of whether the packaging library is available. Add edge case tests for the fallback path to document this behavior. Co-authored-by: Cursor <[email protected]>
raksrh
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_resolve_core_package()to handle three formats for--acv: PyPI versions (2.19.0), GitHub branch names (devel,milestone,stable-2.16), and direct URLs_install_core()to use the resolver instead of always appending==version--acvhelp text to document the new accepted formatsThis enables tox-ansible to delegate collection installation to ade using branch-based ansible-core builds, removing duplicated collection build/install logic between the two tools and gaining full Python dependency resolution via
ansible-builder introspect.Test plan
ade install . --acv devel --no-seedinstalls ansible-core from devel branchade install . --acv stable-2.16 --no-seedinstalls ansible-core from stable branchMade with Cursor