Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
ea9726dc
Unverified
Commit
ea9726dc
authored
Mar 14, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for disjunctive python constraint
parent
d348518b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
4 deletions
+34
-4
tests/installation/fixtures/with-optional-dependencies.test
+3
-3
tests/semver/test_version_parser.py
+19
-0
tests/test_poetry.py
+1
-1
tests/version/__init__.py
+0
-0
tests/version/test_helpers.py
+11
-0
No files found.
tests/installation/fixtures/with-optional-dependencies.test
View file @
ea9726dc
...
...
@@ -17,7 +17,7 @@ python-versions = "*"
platform
=
"*"
[
package
.
requirements
]
python
=
">= 2.7.0.0 < 2.8.0.0"
python
=
">= 2.7.0.0
,
< 2.8.0.0"
[[
package
]]
name
=
"C"
...
...
@@ -32,7 +32,7 @@ platform = "*"
D
=
"^1.2"
[
package
.
requirements
]
python
=
">= 3.6.0.0 < 4.0.0.0"
python
=
">= 3.6.0.0
,
< 4.0.0.0"
[[
package
]]
name
=
"D"
...
...
@@ -44,7 +44,7 @@ python-versions = "*"
platform
=
"*"
[
package
.
requirements
]
python
=
">= 3.6.0.0 < 4.0.0.0"
python
=
">= 3.6.0.0
,
< 4.0.0.0"
[
metadata
]
python
-
versions
=
"~2.7 || ^3.4"
...
...
tests/semver/test_version_parser.py
View file @
ea9726dc
...
...
@@ -63,6 +63,25 @@ def test_parse_constraints_wildcard(parser, input, min, max):
@pytest.mark.parametrize
(
'input,min,max'
,
[
(
'!=v2.*'
,
Constraint
(
'<'
,
'2.0.0.0'
),
Constraint
(
'>='
,
'3.0.0.0'
)),
(
'!=2.*.*'
,
Constraint
(
'<'
,
'2.0.0.0'
),
Constraint
(
'>='
,
'3.0.0.0'
)),
(
'!=2.0.*'
,
Constraint
(
'<'
,
'2.0.0.0'
),
Constraint
(
'>='
,
'2.1.0.0'
)),
(
'!=0.*'
,
None
,
Constraint
(
'>='
,
'1.0.0.0'
)),
(
'!=0.*.*'
,
None
,
Constraint
(
'>='
,
'1.0.0.0'
)),
]
)
def
test_parse_constraints_negative_wildcard
(
parser
,
input
,
min
,
max
):
if
min
:
expected
=
MultiConstraint
((
min
,
max
),
conjunctive
=
False
)
else
:
expected
=
max
assert
str
(
parser
.
parse_constraints
(
input
))
==
str
(
expected
)
@pytest.mark.parametrize
(
'input,min,max'
,
[
(
'~v1'
,
Constraint
(
'>='
,
'1.0.0.0'
),
Constraint
(
'<'
,
'2.0.0.0'
)),
(
'~1.0'
,
Constraint
(
'>='
,
'1.0.0.0'
),
Constraint
(
'<'
,
'1.1.0.0'
)),
(
'~1.0.0'
,
Constraint
(
'>='
,
'1.0.0.0'
),
Constraint
(
'<'
,
'1.1.0.0'
)),
...
...
tests/test_poetry.py
View file @
ea9726dc
...
...
@@ -24,7 +24,7 @@ def test_poetry():
assert
package
.
keywords
==
[
"packaging"
,
"dependency"
,
"poetry"
]
assert
package
.
python_versions
==
'~2.7 || ^3.6'
assert
str
(
package
.
python_constraint
)
==
'>= 2.7.0.0
< 2.8.0.0 || >= 3.6.0.0
< 4.0.0.0'
assert
str
(
package
.
python_constraint
)
==
'>= 2.7.0.0
, < 2.8.0.0 || >= 3.6.0.0,
< 4.0.0.0'
dependencies
=
package
.
requires
cleo
=
dependencies
[
0
]
...
...
tests/version/__init__.py
0 → 100644
View file @
ea9726dc
tests/version/test_helpers.py
0 → 100644
View file @
ea9726dc
from
poetry.version.helpers
import
format_python_constraint
from
poetry.semver.version_parser
import
VersionParser
def
test_format_python_constraint
():
parser
=
VersionParser
()
constraint
=
parser
.
parse_constraints
(
'~2.7 || ^3.6'
)
result
=
format_python_constraint
(
constraint
)
assert
result
==
'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment