Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept period in repo path regex #193

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mikepurvis
Copy link
Contributor

Example:

import rosdistro
import re

rosdistro.repository_specification.RepositorySpecification.VCS_REGEX = re.compile(
    r'(?:https?:\/\/|ssh:\/\/|git:\/\/|git@)((?:[a-fA-F0-9]{40}@)?[\w.-]+)[:/]([\w./-]*)(?:\.git)?$')

index = rosdistro.get_index(rosdistro.get_index_url())
dist = rosdistro.get_distribution(index, "rolling")
for repo_name, repo_data in dist.repositories.items():
    if source := repo_data.source_repository:
        print(source.get_url_parts())

Without the monkey patch to the proposed regex, this fails on the current rolling:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/mikepurvis/rosdistro2nix/rosdistro2nix/cli.py", line 36, in main
    print(source.get_url_parts())
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mikepurvis/.cache/pypoetry/virtualenvs/rosdistro2nix-m92NI1Ci-py3.12/lib/python3.12/site-packages/rosdistro/repository_specification.py", line 62, in get_url_parts
    raise RuntimeError('VCS url "%s" does not match expected format.' % self.url)
RuntimeError: VCS url "https://gitlab.com/autowarefoundation/autoware.auto/acado_vendor.git" does not match expected format.

This prevents it from sucking up the optional .git
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@cottsay cottsay added the bug label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants