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

RequirementsInfoExtractor.py: Extract Project Dependency Info #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Wert1996
Copy link
Contributor

Extract Project Dependency Info
from requirements.txt.

Closes #154

@gitmate-bot
Copy link

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 commit.

"""


class RequirementsInfoExtractorTest(unittest.TestCase):

This comment was marked as outdated.

@@ -0,0 +1,33 @@
from requirements import parse

This comment was marked as resolved.

version=VersionInfo(fname,
''.join(str(i) for i in
dependency.specs[0]))
)
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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
Copy link
Member

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.
"""
Copy link
Member

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 :)



class RequirementsInfoExtractor(InfoExtractor):
supported_file_globs = ("requirements.txt",)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants