-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: Change requirements parser #327
feat: Change requirements parser #327
Conversation
@mostafa thanks in advance for all your work. Please make sure to read and apply to the CONTRIBUTING guidelines , |
b06339a
to
1f2abb7
Compare
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.
Since I replaced the requirements parser, I think it fixed most of the issues and shortcomings of the previous one including nested file parsing, local and remote packages, etc. I followed @jkowalleck's suggestions by following and apply the CONTRIBUTING guidelines and at least the tests pass on my machine on Python 3.9 along with mypy
and flake8
.
I'd be very happy to have your feedback. @madpah @jkowalleck
Windows tests failed because of temp files nagging about permissions, so I tried to use a slightly different approach with roughly the same code: 333ca07. |
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.
@mostafa - firstly - massive thanks for the PR. Great work.
Two questions from me raised in the review:
- To confirm the lowest version of the
pip-requirements-parser
that will work - We need to update documentation to reflect your awesome work - let me know if you need a hand with this.
@mostafa - I'm proposing that this PR will address the following list of issues - do you agree? Fixes: |
@madpah Thanks for the review. The PR hits multiple issues with the same stone. 😄 I'd be happy to write docs, too. So, I'll update the PR with docs changes soon. |
…sion Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
feat: Add support for hashes, local packages and private repositories Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
…raryFileWrapper Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
a78ac9e
to
90b336f
Compare
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
@madpah Can you give me a hand in updating the docs? 🙏 |
@mostafa - just looks like an issue reported by |
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
⭐ Massive thanks for this contribution @mostafa ⭐ |
In this PR, I replaced the
pkg_resources
fromsetuptools
withpip-requirements-parser
. This change helps with better parsing ofrequirements.txt
files because it supports local files, private repositories, hashes, and possibly other features. which I haven't looked into or tested. This PR tries to address the PRs mentioned in this discussion: #319.As you might have noticed by now from the commits, these are the changes I made:
RequirementsParser
class:test_example_local_packages
tests references to local files with no nested file parsing.test_example_local_and_nested_packages
tests references to local files and remote URLs (pointing to files) that also include a parsed requirements line from a nested file.test_example_private_packages
: tests extra URLs.test_example_with_urls
: tests requirements as URLs.test_example_with_hashes
.file.close()
lines.RequirementsFileParser
now supports nested files.