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
bf2ff70a
Unverified
Commit
bf2ff70a
authored
Nov 26, 2019
by
Sébastien Eustace
Committed by
GitHub
Nov 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix source references not being locked for legacy packages (#1635)
parent
c77b4425
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
3 deletions
+38
-3
poetry/packages/locker.py
+4
-3
tests/packages/test_locker.py
+34
-0
No files found.
poetry/packages/locker.py
View file @
bf2ff70a
...
...
@@ -139,7 +139,7 @@ class Locker(object):
package
.
add_dependency
(
dep_name
,
constraint
)
if
"source"
in
info
:
package
.
source_type
=
info
[
"source"
]
[
"type"
]
package
.
source_type
=
info
[
"source"
]
.
get
(
"type"
,
""
)
package
.
source_url
=
info
[
"source"
][
"url"
]
package
.
source_reference
=
info
[
"source"
][
"reference"
]
...
...
@@ -294,11 +294,12 @@ class Locker(object):
data
[
"dependencies"
]
=
dependencies
if
package
.
source_
type
:
if
package
.
source_
url
:
data
[
"source"
]
=
{
"type"
:
package
.
source_type
,
"url"
:
package
.
source_url
,
"reference"
:
package
.
source_reference
,
}
if
package
.
source_type
:
data
[
"source"
][
"type"
]
=
package
.
source_type
return
data
tests/packages/test_locker.py
View file @
bf2ff70a
...
...
@@ -212,3 +212,37 @@ A = []
_
=
locker
.
lock_data
assert
"Unable to read the lock file"
in
str
(
e
.
value
)
def
test_locking_legacy_repository_package_should_include_source_section
(
root
,
locker
):
package_a
=
get_package
(
"A"
,
"1.0.0"
)
package_a
.
source_url
=
"https://foo.bar"
package_a
.
source_reference
=
"legacy"
packages
=
[
package_a
]
locker
.
set_lock_data
(
root
,
packages
)
with
locker
.
lock
.
open
(
encoding
=
"utf-8"
)
as
f
:
content
=
f
.
read
()
expected
=
"""[[package]]
category = "main"
description = ""
name = "A"
optional = false
python-versions = "*"
version = "1.0.0"
[package.source]
reference = "legacy"
url = "https://foo.bar"
[metadata]
content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8"
python-versions = "*"
[metadata.files]
A = []
"""
assert
expected
==
content
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