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

incorrect and/or precedence in marker evaluation #71

Closed
LnL7 opened this issue Mar 9, 2020 · 1 comment
Closed

incorrect and/or precedence in marker evaluation #71

LnL7 opened this issue Mar 9, 2020 · 1 comment

Comments

@LnL7
Copy link
Contributor

LnL7 commented Mar 9, 2020

The evaluation in poetry2nix doesn't take and/or precedence into account, which causes problems with more complex conditionals. Like conditional dependencies which propagate their marker resulting in multiple conditions. eg.

foo; python_version > "3.4"
bar; sys_platform == "win32"  # depends on foo
nix-repl> evalPep508 ''python_version > "3.4" or python_version > "3.4" and sys_platform == "win32"''
false
nix-repl> evalPep508 ''python_version > "3.4" and sys_platform == "win32" or python_version > "3.4"''
true

Compared to the packaging module.

In [1]: from packaging.markers import Marker
In [2]: Marker('python_version > "3.4" or python_version > "3.4" and sys_platform == "win32"').evaluate()
Out[2]: True
In [3]: Marker('python_version > "3.4" and sys_platform == "win32" or python_version > "3.4"').evaluate()
Out[3]: True
@adisbladis
Copy link
Member

Closed in b7617a7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants