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

Python dist deps: Put bounded requirements into parenthesis #996

Merged

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jan 3, 2020

Fixes #995

For this input: pyparsing>=2.0.1,!=2.0.4,!=2.1.2,!=2.1.6

Instead of (invalid):
(python3.8dist(pyparsing) >= 2.0.1 with
python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0 with
python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0 with
python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0)

Produces (valid):
(python3.8dist(pyparsing) >= 2.0.1 with
(python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0) with
(python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0) with
(python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0))

For this input: babel>=1.3,!=2.0

Instead of (invalid):
(python3.8dist(babel) >= 1.3 with
python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0)

Produces (valid):
(python3.8dist(babel) >= 1.3 with
(python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0))

For this input: pbr!=2.1.0,>=2.0.0

Instead of (invalid):
(python3.8dist(pbr) >= 2 with
python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0)

Produces (valid):
(python3.8dist(pbr) >= 2 with
(python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0))

Fixes rpm-software-management#995

For this input: pyparsing>=2.0.1,!=2.0.4,!=2.1.2,!=2.1.6

Instead of (invalid):
(python3.8dist(pyparsing) >= 2.0.1 with
 python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0 with
 python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0 with
 python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0)

Produces (valid):
(python3.8dist(pyparsing) >= 2.0.1 with
 (python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0) with
 (python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0) with
 (python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0))

For this input: babel>=1.3,!=2.0

Instead of (invalid):
(python3.8dist(babel) >= 1.3 with
 python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0)

Produces (valid):
(python3.8dist(babel) >= 1.3 with
 (python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0))

For this input: pbr!=2.1.0,>=2.0.0

Instead of (invalid):
(python3.8dist(pbr) >= 2 with
 python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0)

Produces (valid):
(python3.8dist(pbr) >= 2 with
 (python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0))
@ignatenkobrain
Copy link
Contributor

I think the translation to rpm deps is not correct in some of these cases, but the patch definitely fixes the original problem.

@ignatenkobrain ignatenkobrain merged commit 2ea0b3a into rpm-software-management:master Jan 3, 2020
jollaitbot pushed a commit to sailfishos-mirror/python-rpm-generators that referenced this pull request Apr 14, 2020
Puts bounded requirements into parenthesis

Fixes: rpm-software-management/rpm#995
Upstream: rpm-software-management/rpm#996

For this input: pyparsing>=2.0.1,!=2.0.4,!=2.1.2,!=2.1.6

Instead of (invalid):
(python3.8dist(pyparsing) >= 2.0.1 with
 python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0 with
 python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0 with
 python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0)

Produces (valid):
(python3.8dist(pyparsing) >= 2.0.1 with
 (python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0) with
 (python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0) with
 (python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0))

For this input: babel>=1.3,!=2.0

Instead of (invalid):
(python3.8dist(babel) >= 1.3 with
 python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0)

Produces (valid):
(python3.8dist(babel) >= 1.3 with
 (python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0))

For this input: pbr!=2.1.0,>=2.0.0

Instead of (invalid):
(python3.8dist(pbr) >= 2 with
 python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0)

Produces (valid):
(python3.8dist(pbr) >= 2 with
 (python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0))
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

Successfully merging this pull request may close these issues.

Python requires generator: Cannot chain different ops: or + with
3 participants