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
4da3bcb3
Unverified
Commit
4da3bcb3
authored
Mar 26, 2022
by
Randy Döring
Committed by
GitHub
Mar 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not write PEP610 URL reference for cached packages installed from a private source (#5362)
parent
e1b8dd9c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
src/poetry/installation/executor.py
+2
-2
tests/installation/test_executor.py
+36
-0
No files found.
src/poetry/installation/executor.py
View file @
4da3bcb3
...
@@ -725,11 +725,11 @@ class Executor:
...
@@ -725,11 +725,11 @@ class Executor:
package
=
operation
.
package
package
=
operation
.
package
if
not
package
.
source_url
:
if
not
package
.
source_url
or
package
.
source_type
==
"legacy"
:
# Since we are installing from our own distribution cache
# Since we are installing from our own distribution cache
# pip will write a `direct_url.json` file pointing to the cache
# pip will write a `direct_url.json` file pointing to the cache
# distribution.
# distribution.
# That's not what we want so we remove the direct_url.json file,
# That's not what we want
,
so we remove the direct_url.json file,
# if it exists.
# if it exists.
for
(
for
(
direct_url_json
direct_url_json
...
...
tests/installation/test_executor.py
View file @
4da3bcb3
...
@@ -411,6 +411,42 @@ def verify_installed_distribution(
...
@@ -411,6 +411,42 @@ def verify_installed_distribution(
assert
not
direct_url_file
.
exists
()
assert
not
direct_url_file
.
exists
()
@pytest.mark.parametrize
(
"package"
,
[
Package
(
"demo"
,
"0.1.0"
),
# PyPI
Package
(
# private source
"demo"
,
"0.1.0"
,
source_type
=
"legacy"
,
source_url
=
"http://localhost:3141/root/pypi/+simple"
,
source_reference
=
"private"
,
),
],
)
def
test_executor_should_not_write_pep610_url_references_for_cached_package
(
package
:
Package
,
mocker
:
MockerFixture
,
fixture_dir
:
FixtureDirGetter
,
tmp_venv
:
VirtualEnv
,
pool
:
Pool
,
config
:
Config
,
io
:
BufferedIO
,
):
link_cached
=
Link
(
fixture_dir
(
"distributions"
)
.
joinpath
(
"demo-0.1.0-py2.py3-none-any.whl"
)
.
as_uri
()
)
mocker
.
patch
(
"poetry.installation.executor.Executor._download"
,
return_value
=
link_cached
)
executor
=
Executor
(
tmp_venv
,
pool
,
config
,
io
)
executor
.
execute
([
Install
(
package
)])
verify_installed_distribution
(
tmp_venv
,
package
)
def
test_executor_should_write_pep610_url_references_for_files
(
def
test_executor_should_write_pep610_url_references_for_files
(
tmp_venv
:
VirtualEnv
,
pool
:
Pool
,
config
:
Config
,
io
:
BufferedIO
tmp_venv
:
VirtualEnv
,
pool
:
Pool
,
config
:
Config
,
io
:
BufferedIO
):
):
...
...
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