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
fails on extras syntax #70
Comments
Yeah, unfortunately, it means you have to do |
Just encountered this myself, I also assumed I could do |
One issue is that hashin doesn't resolve any dependencies. The only difference between That being said, it would be amazing if hashin supported resolving dependencies, and at that point it would be nice to support the extras syntax, and probably an easy additional feature. |
Not sure I follow. In the example above, "yapf" is an just an extra whose name happens to correspond to the Regardless of the additional dependencies that may or may not be installed, it does make sense to allow the user to specify extras. For example, this is the current behavior:
This is the desired behavior:
This is not the same as:
|
Ah, thinking about this a bit more I understand what's going on now. I actually ran into this recently. In the above case, listing @peterbe I think there is benefit in this feature. Hashin would only use the |
If this is true it's merely a coincidence, listing |
Yes, sorry. I was trying to draw a distinction between |
Easy. We just treat the package name as I do worry that people might get false hopes from it though. For example, if you do I guess we'll have to deal with that worry at some point but that's not now. Today, if I want $ hashin -r reqs.txt requests
$ hashin -r constraints.txt cryptography PyOpenSSL urllib3 idna
$ emacs reqs.txt # and replace 'requests' with 'requests[security]` If it would just be: $ hashin -r reqs.txt "requests[security]"
$ hashin -r constraints.txt cryptography PyOpenSSL urllib3 idna ...it would be nice. I can take care of that. |
I'd recommend using the
|
Awesome catch. I would have actually gone ahead with doing a home-made string trick on it myself. |
Bummer that >>> from packaging.requirements import Requirement
>>> req = Requirement("requests[security,additional]")
>>> req.extras
{'additional', 'security'}
>>> ','.join(req.extras)
'additional,security' Do you know if there's a strong reason for that to be a set? |
Because the order doesn't matter. 🙂 |
* allow extras syntax Fixes #70 * use Requirement().str() instead
example:
The text was updated successfully, but these errors were encountered: