Skip to content

[BUG] [V2] pixi script parser splits git+ URLs on the first @ (breaks ssh://git@ and credentialed URLs) #8450

Open
flyteorg/flyte-sdk
#1863

Description

@m86hussein

Describe the bug

When building an image from a pixi PEP 723 script, _pypi_requirement_to_pixi (src/flyte/_utils/pixi_script_parser.py) converts git+ requirements with partition("@"), which splits on the first @ in the URL. Any @ in the URL authority is therefore treated as the revision separator:

Requirement Rendered pixi spec
pkg @ git+ssh://git@github.com/org/repo.git@v1.0 {git = "ssh://git", rev = "github.com/org/repo.git@v1.0"}
pkg @ git+ssh://git@github.com/org/repo.git {git = "ssh://git", rev = "github.com/org/repo.git"}
pkg @ git+https://user:token@github.com/org/repo.git@main {git = "https://user:token", rev = "github.com/org/repo.git@main"}
pkg @ git+https://github.com/org/repo.git@main#subdirectory=sub {git = "https://github.com/org/repo.git", rev = "main#subdirectory=sub"}

ssh://git@... is the URL form pixi itself documents for git dependencies, so private-repo dependencies cannot be installed this way, and the subdirectory fragment is never mapped to pixi's subdirectory key.

To Reproduce

from flyte._utils.pixi_script_parser import _pypi_requirement_to_pixi

print(_pypi_requirement_to_pixi("pkg @ git+ssh://git@github.com/org/repo.git@v1.0"))
# ('pkg', {'git': 'ssh://git', 'rev': 'github.com/org/repo.git@v1.0'})

Expected behavior

('pkg', {'git': 'ssh://git@github.com/org/repo.git', 'rev': 'v1.0'})

User info stays in git, only an @ in the URL path marks the revision, and #subdirectory=sub becomes subdirectory = "sub".

Suggested fix

Parse the URL with urllib.parse.urlsplit, take the revision via rpartition("@") on the path only, and map the subdirectory fragment to pixi's subdirectory key.

Environment

  • flyte-sdk main (6df18e4)
  • Python 3.12

Activity

  1. runllm commented on Nov 22, 2026

    @runllm

    The reported bug is supported by the current parser: it splits git+ URLs at the first @ and only maps the result to git and optional rev; the provided source does not show handling for a subdirectory fragment. Parser source The tests cover a simple Git URL with a revision, but not @ in the authority or subdirectory. Parser tests

    Sources:


    This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

    Mention @Herald to ask follow-up questions. See runllm.com for more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions