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
add support for Pipfile.lock #216
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #216 +/- ##
==========================================
- Coverage 74.28% 74.15% -0.13%
==========================================
Files 7 7
Lines 350 356 +6
==========================================
+ Hits 260 264 +4
- Misses 90 92 +2
Continue to review full report at Codecov.
|
Why have a separate argument for Pipfile instead of using |
Because we don't have access to the filename when using stdin. But what we could do would be to check if the file contains valid JSON data, and in this case assume it is a Pipfile.lock. eg: nim65s@575636a I'll let the maintainers of this project choose :) |
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 code looks really good. What I am trying to judge is whether it would make sense to add another file read function here. You pointed it very well at the beginning of your PR that we might instead need a refactor and properly use dparse library to read requirements from virtually any file.
I see why you added another option, but as @GhostofGoes noticed, we should just use -f
instead. Detecting the file type, or being able to parse different file types, is for sure a dparse responsibility. What I would not like to do is to add one another option for each file type. At most, if we see dparse will not be able to detect the file type, we should use one option to point out different possible file types.
+1 |
Hi,
This PR adds support for
Pipfile.lock
(https://github.com/pypa/pipfile), with a new-p
option for the CLI, a really simpleread_pipfile
util inspired from the existingread_requirements
, and a unit test.Another option to add this suppport (and support other formats), would be to refactor
read_requirements
to let dparse get the requirements from multiple formats, maybe with a CLI switch withdparse.filetypes
as choices.