-
Notifications
You must be signed in to change notification settings - Fork 76
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
RequirementsInfoExtractor.py: Extract Project Dependency Info #159
base: master
Are you sure you want to change the base?
Conversation
Comment on a6397c2. Shortlog of the HEAD commit contains 61 character(s). This is 11 character(s) longer than the limit (61 > 50). GitCommitBear, severity NORMAL, section |
""" | ||
|
||
|
||
class RequirementsInfoExtractorTest(unittest.TestCase): |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
@@ -0,0 +1,33 @@ | |||
from requirements import parse |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
version=VersionInfo(fname, | ||
''.join(str(i) for i in | ||
dependency.specs[0])) | ||
) |
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.
This doesn't look right... Looks like we are taking into consideration only the first version.
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.
I have a suggestion, we could change the VersionInfo
to either store a list instead of string, or we could add an optional other_versions
parameter which will store such versions.
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.
^^ This could be done in a separate commit. If you don't want to do this in this PR, just add a #FIXME comment and create an issue about it 👍
fname, | ||
dependency.name, | ||
version=VersionInfo(fname, | ||
''.join(str(i) for i in |
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.
just
''.join(dependency.specs[0])
should work imo
Django>=1.5 # This is a comment. | ||
Jinja~2.9.6 | ||
# Neither this. | ||
""" |
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.
add a test case for multiple version case as well :)
a6397c2
to
8c26dd0
Compare
8c26dd0
to
bcd5bf9
Compare
bcd5bf9
to
3f450e8
Compare
|
||
|
||
class RequirementsInfoExtractor(InfoExtractor): | ||
supported_file_globs = ("requirements.txt",) |
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 do not use the preferred quotation marks.
Origin: QuotesBear, Section: all.quotes
.
The issue can be fixed by applying the following patch:
--- a/tmp/tmpcl3_n9ei/coala_quickstart/info_extractors/RequirementsInfoExtractor.py
+++ b/tmp/tmpcl3_n9ei/coala_quickstart/info_extractors/RequirementsInfoExtractor.py
@@ -6,7 +6,7 @@
class RequirementsInfoExtractor(InfoExtractor):
- supported_file_globs = ("requirements.txt",)
+ supported_file_globs = ('requirements.txt',)
supported_information_kinds = (
ProjectDependencyInfo, VersionInfo)
Extract Project Dependency Info from requirements.txt. Closes coala#154
Extract Project Dependency Info
from requirements.txt.
Closes #154