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
bdd7909c
Unverified
Commit
bdd7909c
authored
Oct 24, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Python-Requires being invalid for single Python versions
parent
857052a0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
2 deletions
+38
-2
CHANGELOG.md
+1
-0
poetry/version/helpers.py
+4
-1
tests/masonry/builders/fixtures/single_python/README.rst
+2
-0
tests/masonry/builders/fixtures/single_python/pyproject.toml
+16
-0
tests/masonry/builders/fixtures/single_python/single_python.py
+3
-0
tests/masonry/builders/test_sdist.py
+12
-1
No files found.
CHANGELOG.md
View file @
bdd7909c
...
...
@@ -8,6 +8,7 @@
-
Fixed possible errors when resolving dependencies for specific packages.
-
Fixed handling of Python versions compatibility.
-
Fixed the dependency resolver picking up unnecessary dependencies due to not using the
`python_full_version`
marker.
-
Fixed the
`Python-Requires`
metadata being invalid for single Python versions.
## [0.12.4] - 2018-10-21
...
...
poetry/version/helpers.py
View file @
bdd7909c
...
...
@@ -21,7 +21,10 @@ def format_python_constraint(constraint):
This helper will help in transforming
disjunctive constraint into proper constraint.
"""
if
isinstance
(
constraint
,
Version
)
and
constraint
.
precision
<
3
:
if
isinstance
(
constraint
,
Version
):
if
constraint
.
precision
>=
3
:
return
"=={}"
.
format
(
str
(
constraint
))
# Transform 3.6 or 3
if
constraint
.
precision
==
2
:
# 3.6
...
...
tests/masonry/builders/fixtures/single_python/README.rst
0 → 100644
View file @
bdd7909c
Single Python
=============
tests/masonry/builders/fixtures/single_python/pyproject.toml
0 → 100644
View file @
bdd7909c
[tool.poetry]
name
=
"single-python"
version
=
"0.1"
description
=
"Some description."
authors
=
[
"Sébastien Eustace <sebastien@eustace.io>"
]
license
=
"MIT"
readme
=
"README.rst"
homepage
=
"https://poetry.eustace.io/"
[tool.poetry.dependencies]
python
=
"2.7.15"
tests/masonry/builders/fixtures/single_python/single_python.py
0 → 100644
View file @
bdd7909c
"""Example module"""
__version__
=
"0.1"
tests/masonry/builders/test_sdist.py
View file @
bdd7909c
...
...
@@ -471,7 +471,7 @@ def test_default_with_excluded_data(mocker):
assert
"my-package-1.2.3/PKG-INFO"
in
names
def
test_proper_python_requires_if_
single
_version_specified
():
def
test_proper_python_requires_if_
two_digits_precision
_version_specified
():
poetry
=
Poetry
.
create
(
project
(
"simple_version"
))
builder
=
SdistBuilder
(
poetry
,
NullEnv
(),
NullIO
())
...
...
@@ -480,3 +480,14 @@ def test_proper_python_requires_if_single_version_specified():
parsed
=
p
.
parsestr
(
to_str
(
pkg_info
))
assert
parsed
[
"Requires-Python"
]
==
">=3.6,<3.7"
def
test_proper_python_requires_if_three_digits_precision_version_specified
():
poetry
=
Poetry
.
create
(
project
(
"single_python"
))
builder
=
SdistBuilder
(
poetry
,
NullEnv
(),
NullIO
())
pkg_info
=
builder
.
build_pkg_info
()
p
=
Parser
()
parsed
=
p
.
parsestr
(
to_str
(
pkg_info
))
assert
parsed
[
"Requires-Python"
]
==
"==2.7.15"
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