-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix METADATA generation for git dependencies with extras #1129
Conversation
Any chance we could get this merged soon? |
poetry/packages/vcs_dependency.py
Outdated
@@ -71,6 +71,11 @@ def base_pep_508_name(self): # type: () -> str | |||
|
|||
requirement += " @ {}+{}@{}".format(self._vcs, self._source, self.reference) | |||
|
|||
# add trailing space if 'extra' field is specified between URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base_pep_508_name
property should return the base name without any extra space since this is the pre-marker part of a dependency.
This code should instead by but inside the to_pep_508()
method.
# Conflicts: # tests/packages/test_vcs_dependency.py
# Conflicts: # tests/packages/test_vcs_dependency.py
@sdispater I moved the code to the |
Explicitly import io.open (#1212)
poetry/packages/vcs_dependency.py
Outdated
# add trailing space if 'extra' field is specified between URL | ||
# and ';' | ||
if self.in_extras: | ||
requirement = requirement.replace("; extra", " ; extra") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That won't work if there are other markers (like python_version
)
Any update on this? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fsal Here is an idea that feels more explicit than finding the first semicolon.
in dependency.py Line 202
if markers:
if self.is_vcs():
# url based requirements should have a space before semicolon
# https://www.python.org/dev/peps/pep-0508/#grammar
requirement += " "
if len(markers) > 1:
markers = ["({})".format(m) for m in markers]
requirement += "; {}".format(" and ".join(markers))
else:
requirement += "; {}".format(markers[0])
return requirement
Could you implement this and also If add a test case with multiple markers? If so I think we can get this merged in.
Also if you could squash all your commits together that would be nice. If not we'll do it at merge time. Thanks!
Update to last version
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #1114
Insert trailing space at the end of the github URL before the semicolon when
extra
field id specified. This trick preventspip
parser to include the semicolon (that is a avalid URL character) in the URL. In this waypip
can install the wheel properly.Tested with
poetry 0.12.16
,poetry 1.0.0a3
andpip 19.1.1
.Pull Request Check List