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

Support subdirectory in VCS requirements #48

Closed
pazeshun opened this issue Oct 10, 2019 · 2 comments
Closed

Support subdirectory in VCS requirements #48

pazeshun opened this issue Oct 10, 2019 · 2 comments

Comments

@pazeshun
Copy link

pazeshun commented Oct 10, 2019

I want to use subdirectory syntax in requirements.txt to install a python module in a subdirectory of a repository:

-e git+https://github.com/cocodataset/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI

subdirectory syntax is written at https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support
However, I encountered the following error when I ran catkin build:

Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/catkin_virtualenv/combine_requirements", line 85, in <module>
    sys.exit(combine_requirements(**vars(args)))
  File "/opt/ros/kinetic/lib/catkin_virtualenv/combine_requirements", line 56, in combine_requirements
    requirement_string, str(vcs_err), str(semver_err)))
RuntimeError: Could not match requirement -e git+https://github.com/cocodataset/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI for VCS (No match for ^(?P<scheme>git|git\+https|git\+ssh|git\+git|hg\+http|hg\+https|hg\+static-http|hg\+ssh|svn|svn\+svn|svn\+http|svn\+https|svn\+ssh|bzr\+http|bzr\+https|bzr\+ssh|bzr\+sftp|bzr\+ftp|bzr\+lp)://((?P<login>[^/@]+)@)?(?P<path>[^#@]+)(@(?P<revision>[^#]+))?(#egg=(?P<name>[^&]+))?$) or SemVer (Invalid requirement, parse error at "'-e git+h'")
make[2]: *** [generated_requirements.txt] Error 1

#40 doesn't seem to support the subdirectory syntax.

@paulbovbel
Copy link
Member

Hi @pazeshun, you're right, that particular argument isn't supported.

Since catkin_virtualenv doesn't actually care about the details of the VCS requirement beyond the package name, it should be a matter of extending the regex to be more permissive. If this use-case interests you, please consider submitting a PR!

@paulbovbel
Copy link
Member

Resolved as a side-effect of #55

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

No branches or pull requests

2 participants