Skip to content

mamba-ssm setup.py fails with InvalidVersion for vendor PyTorch/CUDA version strings instead of falling back to source build #947

@janbernloehr

Description

@janbernloehr

Summary

Installing mamba-ssm can fail during wheel build when setup.py:get_wheel_url() parses vendor-specific PyTorch/CUDA version metadata with packaging.version.parse. If the environment contains a non-PEP-440 vendor build string, get_wheel_url() raises packaging.version.InvalidVersion and aborts the install instead of falling back to a source build.

This is reproducible in vendor PyTorch containers where CUDA/PyTorch build metadata may be exported as values like gpgpu.<build-id>.

Observed failure

Package:

  • mamba-ssm==2.3.2.post1
  • Python 3.12
  • Linux x86_64
  • Vendor/internal PyTorch prerelease container

During installation as a transitive dependency:

Building mamba-ssm==2.3.2.post1
× Failed to build `mamba-ssm==2.3.2.post1`
...
File "<string>", line 340, in run
File "<string>", line 315, in get_wheel_url
File ".../packaging/version.py", line 103, in parse
  return Version(version)
File ".../packaging/version.py", line 361, in __init__
  raise InvalidVersion(f"Invalid version: {version!r}")
packaging.version.InvalidVersion: Invalid version: 'gpgpu.<build-id>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions