Open pfmoore opened 2 years ago
Is that the best way of doing this?
It's at least what first came to mind for me. 😁
I think this also ties into https://github.com/pypa/packaging/issues/496 which wanted to expose the AST of markers.
But otherwise overriding &
and |
to combine markers seems reasonable to me as a way to build them up.
I'm trying to write a PEP 621 consumer, and I'm having trouble with the
optional-dependencies
item. The issue is that I could potentially need to combine markers, and I don't see a particularly reliable way of doing so. Consider:To construct
Requires-Dist
from this, I need to add a dependencypywin32; os_name == 'nt' and extra == 'test'
.The best way I can see of doing this is
Is that the best way of doing this? It would be extremely useful in this situation if markers supported
&
and|
operations, to avoid the error-prone conversion to and from strings.