-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Requirements Refactor (ready to merge, after conflict resolution) #1962
Requirements Refactor (ready to merge, after conflict resolution) #1962
Conversation
tests/unit/test_utils.py
Outdated
@@ -108,7 +109,7 @@ def test_convert_from_pip(expected, requirement): | |||
), | |||
]) | |||
def test_convert_from_pip_vcs_with_extra(expected, requirement): | |||
assert pipenv.utils.convert_deps_from_pip(requirement) == expected | |||
assert pipenv.requirements.PipenvRequirement.from_line(requirement).as_pipfile() == expected |
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.
You can merge this feature into DEP_PIP_PAIRS
to make sure the new parser can catch the extra part.
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.
Not sure I'm following -- all tests are passing
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.
nvm I’ll just push the change here.
8fd9501
to
4aa5a49
Compare
693242f
to
1467f50
Compare
@techalchemy, thanks for the help on IRC. This seems to be working to solve my issue (local |
@ncoghlan I've been sitting on this refactor for awhile, to summarize it essentially provides a compatibility layer between pipenv/pipfile style requirements and pip-style requirements. I wrote it in frustration when I had to fix a bug with the current codebase which breaks anytime someone touches it. I've been contemplating breaking this into a library of its own, which I did with the last thing I had an idea like this for (https://github.com/techalchemy/pythonfinder) to allow for potential expansion independent of pipenv -- the API looks something like this: >>> req = PipenvRequirement.from_line(requirement)
>>> req.as_pipfile()
{'req': {'key': 'value'}}
>>> req = PipenvRequirement.from_pipfile(name, index, {'key': 'value', 'key2': 'value2'})
>>> req.as_line()
-e asdf.whatever#egg=name The object itself offers access to hashes, index, name, vcs, etc just depending on what type of requirement you pass. Check out Will be around on synchronous communication for another hour or two => slack/irc/fb if you have anything general |
@techalchemy Breaking out low level building blocks to make them easier to compose independently seems like a good idea to me. (As one example: it would be cool if |
00e932a
to
cb156b9
Compare
@techalchemy you have the authority to merge your own PRs |
Please resolve merge conflicts. |
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
- Leverage functionality where possible to avoid rework Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
- Also update patch for pip Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
95e850e
to
c154350
Compare
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Signed-off-by: Dan Ryan <dan@danryan.co>
Full refactor of requirements parsing