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
4b3caa7e
Unverified
Commit
4b3caa7e
authored
May 22, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve support for private repositories.
No longer use pip-tools.
parent
22013468
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
209 additions
and
69 deletions
+209
-69
CHANGELOG.md
+1
-0
poetry/packages/__init__.py
+8
-0
poetry/packages/constraints/generic_constraint.py
+2
-7
poetry/repositories/legacy_repository.py
+172
-57
poetry/repositories/pypi_repository.py
+23
-2
poetry/semver/version.py
+2
-2
pyproject.toml
+1
-1
No files found.
CHANGELOG.md
View file @
4b3caa7e
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
-
Improved the
`show`
command to make it easier to check if packages are properly installed.
-
Improved the
`show`
command to make it easier to check if packages are properly installed.
-
The
`script`
command has been deprecated, use
`run`
instead.
-
The
`script`
command has been deprecated, use
`run`
instead.
-
Improved support for private repositories.
-
Expanded version constraints now keep the original version's precision.
-
Expanded version constraints now keep the original version's precision.
### Fixed
### Fixed
...
...
poetry/packages/__init__.py
View file @
4b3caa7e
...
@@ -21,6 +21,14 @@ from .vcs_dependency import VCSDependency
...
@@ -21,6 +21,14 @@ from .vcs_dependency import VCSDependency
def
dependency_from_pep_508
(
name
):
def
dependency_from_pep_508
(
name
):
# Removing comments
parts
=
name
.
split
(
'#'
,
1
)
name
=
parts
[
0
]
.
strip
()
if
len
(
parts
)
>
1
:
rest
=
parts
[
1
]
if
';'
in
rest
:
name
+=
';'
+
rest
.
split
(
';'
,
1
)[
1
]
req
=
Requirement
(
name
)
req
=
Requirement
(
name
)
if
req
.
marker
:
if
req
.
marker
:
...
...
poetry/packages/constraints/generic_constraint.py
View file @
4b3caa7e
...
@@ -58,13 +58,8 @@ class GenericConstraint(BaseConstraint):
...
@@ -58,13 +58,8 @@ class GenericConstraint(BaseConstraint):
return
self
.
_version
return
self
.
_version
def
matches
(
self
,
provider
):
def
matches
(
self
,
provider
):
if
not
isinstance
(
provider
,
(
GenericConstraint
,
EmptyConstraint
)):
if
not
isinstance
(
provider
,
GenericConstraint
):
raise
ValueError
(
return
provider
.
matches
(
self
)
'Generic constraints can only be compared with each other'
)
if
isinstance
(
provider
,
EmptyConstraint
):
return
True
is_equal_op
=
self
.
OP_EQ
is
self
.
_operator
is_equal_op
=
self
.
OP_EQ
is
self
.
_operator
is_non_equal_op
=
self
.
OP_NE
is
self
.
_operator
is_non_equal_op
=
self
.
OP_NE
is
self
.
_operator
...
...
poetry/repositories/legacy_repository.py
View file @
4b3caa7e
This diff is collapsed.
Click to expand it.
poetry/repositories/pypi_repository.py
View file @
4b3caa7e
...
@@ -286,7 +286,6 @@ class PyPiRepository(Repository):
...
@@ -286,7 +286,6 @@ class PyPiRepository(Repository):
if
(
if
(
self
.
_fallback
self
.
_fallback
and
data
[
'requires_dist'
]
is
None
and
data
[
'requires_dist'
]
is
None
and
not
data
[
'requires_python'
]
):
):
self
.
_log
(
self
.
_log
(
'No dependencies found, downloading archives'
,
'No dependencies found, downloading archives'
,
...
@@ -328,6 +327,8 @@ class PyPiRepository(Repository):
...
@@ -328,6 +327,8 @@ class PyPiRepository(Repository):
info
=
self
.
_get_info_from_urls
(
urls
)
info
=
self
.
_get_info_from_urls
(
urls
)
data
[
'requires_dist'
]
=
info
[
'requires_dist'
]
data
[
'requires_dist'
]
=
info
[
'requires_dist'
]
if
not
data
[
'requires_python'
]:
data
[
'requires_python'
]
=
info
[
'requires_python'
]
data
[
'requires_python'
]
=
info
[
'requires_python'
]
return
data
return
data
...
@@ -351,6 +352,7 @@ class PyPiRepository(Repository):
...
@@ -351,6 +352,7 @@ class PyPiRepository(Repository):
def
_get_info_from_wheel
(
self
,
url
def
_get_info_from_wheel
(
self
,
url
):
# type: (str) -> Dict[str, Union[str, List, None]]
):
# type: (str) -> Dict[str, Union[str, List, None]]
info
=
{
info
=
{
'summary'
:
''
,
'requires_python'
:
None
,
'requires_python'
:
None
,
'requires_dist'
:
None
,
'requires_dist'
:
None
,
}
}
...
@@ -368,6 +370,9 @@ class PyPiRepository(Repository):
...
@@ -368,6 +370,9 @@ class PyPiRepository(Repository):
# Assume none
# Assume none
return
info
return
info
if
meta
.
summary
:
info
[
'summary'
]
=
meta
.
summary
or
''
info
[
'requires_python'
]
=
meta
.
requires_python
info
[
'requires_python'
]
=
meta
.
requires_python
if
meta
.
requires_dist
:
if
meta
.
requires_dist
:
...
@@ -378,6 +383,7 @@ class PyPiRepository(Repository):
...
@@ -378,6 +383,7 @@ class PyPiRepository(Repository):
def
_get_info_from_sdist
(
self
,
url
def
_get_info_from_sdist
(
self
,
url
):
# type: (str) -> Dict[str, Union[str, List, None]]
):
# type: (str) -> Dict[str, Union[str, List, None]]
info
=
{
info
=
{
'summary'
:
''
,
'requires_python'
:
None
,
'requires_python'
:
None
,
'requires_dist'
:
None
,
'requires_dist'
:
None
,
}
}
...
@@ -390,6 +396,9 @@ class PyPiRepository(Repository):
...
@@ -390,6 +396,9 @@ class PyPiRepository(Repository):
try
:
try
:
meta
=
pkginfo
.
SDist
(
str
(
filepath
))
meta
=
pkginfo
.
SDist
(
str
(
filepath
))
if
meta
.
summary
:
info
[
'summary'
]
=
meta
.
summary
if
meta
.
requires_python
:
if
meta
.
requires_python
:
info
[
'requires_python'
]
=
meta
.
requires_python
info
[
'requires_python'
]
=
meta
.
requires_python
...
@@ -427,7 +436,7 @@ class PyPiRepository(Repository):
...
@@ -427,7 +436,7 @@ class PyPiRepository(Repository):
unpacked
=
Path
(
temp_dir
)
/
'unpacked'
unpacked
=
Path
(
temp_dir
)
/
'unpacked'
sdist_dir
=
unpacked
/
Path
(
filename
)
.
name
.
rstrip
(
'.tar.gz'
)
sdist_dir
=
unpacked
/
Path
(
filename
)
.
name
.
rstrip
(
'.tar.gz'
)
# Checking for .egg-info
# Checking for .egg-info
at root
eggs
=
list
(
sdist_dir
.
glob
(
'*.egg-info'
))
eggs
=
list
(
sdist_dir
.
glob
(
'*.egg-info'
))
if
eggs
:
if
eggs
:
egg_info
=
eggs
[
0
]
egg_info
=
eggs
[
0
]
...
@@ -439,6 +448,18 @@ class PyPiRepository(Repository):
...
@@ -439,6 +448,18 @@ class PyPiRepository(Repository):
return
info
return
info
# Searching for .egg-info in sub directories
eggs
=
list
(
sdist_dir
.
glob
(
'**/*.egg-info'
))
if
eggs
:
egg_info
=
eggs
[
0
]
requires
=
egg_info
/
'requires.txt'
if
requires
.
exists
():
with
requires
.
open
()
as
f
:
info
[
'requires_dist'
]
=
parse_requires
(
f
.
read
())
return
info
# Still nothing, assume no dependencies
# Still nothing, assume no dependencies
# We could probably get them by executing
# We could probably get them by executing
# python setup.py egg-info but I don't feel
# python setup.py egg-info but I don't feel
...
...
poetry/semver/version.py
View file @
4b3caa7e
...
@@ -417,5 +417,5 @@ class Version(VersionRange):
...
@@ -417,5 +417,5 @@ class Version(VersionRange):
(
self
.
major
,
(
self
.
major
,
self
.
minor
,
self
.
minor
,
self
.
patch
,
self
.
patch
,
'.'
.
join
(
self
.
prerelease
),
'.'
.
join
(
s
tr
(
p
)
for
p
in
s
elf
.
prerelease
),
'.'
.
join
(
self
.
build
)))
'.'
.
join
(
s
tr
(
p
)
for
p
in
s
elf
.
build
)))
pyproject.toml
View file @
4b3caa7e
...
@@ -27,13 +27,13 @@ cleo = "^0.6.6"
...
@@ -27,13 +27,13 @@ cleo = "^0.6.6"
requests
=
"^2.18"
requests
=
"^2.18"
toml
=
"^0.9"
toml
=
"^0.9"
cachy
=
"^0.2"
cachy
=
"^0.2"
pip-tools
=
"^2.0"
requests-toolbelt
=
"^0.8.0"
requests-toolbelt
=
"^0.8.0"
jsonschema
=
"^2.6"
jsonschema
=
"^2.6"
pyrsistent
=
"^0.14.2"
pyrsistent
=
"^0.14.2"
pyparsing
=
"^2.2"
pyparsing
=
"^2.2"
cachecontrol
=
{
version
=
"^0.12.4"
,
extras
=
["filecache"]
}
cachecontrol
=
{
version
=
"^0.12.4"
,
extras
=
["filecache"]
}
pkginfo
=
"^1.4"
pkginfo
=
"^1.4"
html5lib
=
"^1.0"
# The typing module is not in the stdlib in Python 2.7 and 3.4
# The typing module is not in the stdlib in Python 2.7 and 3.4
typing
=
{
version
=
"^3.6"
,
python
=
"~2.7 || ~3.4"
}
typing
=
{
version
=
"^3.6"
,
python
=
"~2.7 || ~3.4"
}
...
...
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