Fixes #999: support python_requires and py_modules in configuration files#1007
Conversation
|
Looks good. Can you add one more commit with an entry to the changelog explaining the change to users? Probably an 0.1 bump. |
|
For future commits, I would recommend instead of committing all the changes in one commit and then explaining the changes in the PR, I'd prefer if you made several commits, each with a commit message explaining what you've explained above. The advantage to that approach is that in a year from now, if someone is tracing through the code history to understand why (for example) the error message was changed, they would readily find a description of the reason, rather than see what looks like a change incidental to the intention of the commit (and then being left to wonder if the change was intentional or incidental or accidental) and if they're lucky, tracing the commit message to the ticket to the PR for more detail. Separate commits also enables selective acceptance and rollback of independent changes. |
|
I fully agree. Sometimes (for whatever reason) project maintainers are averse to fine granular commits -- good to know you aren't! |
|
@mbargull Hi, I wonder why |
|
@idlesign it is rather an expression, than a list of stuff. This checks only one requirement — the version of runtime. I don't think there's machinery for handling and combining a list of such expressions. |
|
@webknjaz Nope, version specifier notation is desribed in PEP 345, and I think we'd have parsed it as a list for better user experience. |
|
Hi @idlesign, well I only followed
And I'm with @webknjaz on this: In comparison to the other |
I'll try to break it down. Let's think about it the following way: If so, we deal with the following two entities:
The same as with:
Requests 2.18 is the same as 3.15? Probably not, despite of the name we have two different applications. And we tokenize The idea is: if we have different entities they should be in different slots. And if I use |
|
@idlesign AFAIK separate entries like requests == 2.18
requests >= 3.15Would cause pip do requests == 2.18, >= 3.15then it would fail instantly when trying to install requirement with two incompatible restrictions. Likewise |
Changes:
self.metadata.python_requires = self.python_requirespatch toDistribution.parse_config_files'py_modules': parse_listtoConfigOptionsHandler.parsersdist.check_specifierConcerning the last point:
packaging.specifiers.SpecifierSet.__init__expects astrand nolist. The fixed error is actually not thrown if alistis provided, since it fails on trying to callsplit(",")and thus will not throw apackaging.specifiers.InvalidSpecifierexception. If this case should be handled properly, it could be done here or rather inpackaging.