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
d3156964
Commit
d3156964
authored
Jan 21, 2023
by
David Hotham
Committed by
Bjorn Neergaard
Jan 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove strange VENDORS handling in installed repository
parent
bd85ae6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
27 deletions
+2
-27
src/poetry/repositories/installed_repository.py
+0
-16
tests/repositories/test_installed_repository.py
+2
-11
No files found.
src/poetry/repositories/installed_repository.py
View file @
d3156964
...
@@ -20,15 +20,6 @@ if TYPE_CHECKING:
...
@@ -20,15 +20,6 @@ if TYPE_CHECKING:
from
poetry.utils.env
import
Env
from
poetry.utils.env
import
Env
_VENDORS
=
Path
(
__file__
)
.
parent
.
parent
.
joinpath
(
"_vendor"
)
try
:
FileNotFoundError
except
NameError
:
FileNotFoundError
=
OSError
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -283,13 +274,6 @@ class InstalledRepository(Repository):
...
@@ -283,13 +274,6 @@ class InstalledRepository(Repository):
if
name
in
seen
:
if
name
in
seen
:
continue
continue
try
:
path
.
relative_to
(
_VENDORS
)
except
ValueError
:
pass
else
:
continue
package
=
cls
.
create_package_from_distribution
(
distribution
,
env
)
package
=
cls
.
create_package_from_distribution
(
distribution
,
env
)
if
with_dependencies
:
if
with_dependencies
:
...
...
tests/repositories/test_installed_repository.py
View file @
d3156964
...
@@ -22,14 +22,12 @@ ENV_DIR = (FIXTURES_DIR / "installed").resolve()
...
@@ -22,14 +22,12 @@ ENV_DIR = (FIXTURES_DIR / "installed").resolve()
SITE_PURELIB
=
ENV_DIR
/
"lib"
/
"python3.7"
/
"site-packages"
SITE_PURELIB
=
ENV_DIR
/
"lib"
/
"python3.7"
/
"site-packages"
SITE_PLATLIB
=
ENV_DIR
/
"lib64"
/
"python3.7"
/
"site-packages"
SITE_PLATLIB
=
ENV_DIR
/
"lib64"
/
"python3.7"
/
"site-packages"
SRC
=
ENV_DIR
/
"src"
SRC
=
ENV_DIR
/
"src"
VENDOR_DIR
=
ENV_DIR
/
"vendor"
/
"py3.7"
INSTALLED_RESULTS
=
[
INSTALLED_RESULTS
=
[
metadata
.
PathDistribution
(
SITE_PURELIB
/
"cleo-0.7.6.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"cleo-0.7.6.dist-info"
),
metadata
.
PathDistribution
(
SRC
/
"pendulum"
/
"pendulum.egg-info"
),
metadata
.
PathDistribution
(
SRC
/
"pendulum"
/
"pendulum.egg-info"
),
metadata
.
PathDistribution
(
metadata
.
PathDistribution
(
zipfile
.
Path
(
str
(
SITE_PURELIB
/
"foo-0.1.0-py3.8.egg"
),
"EGG-INFO"
)
zipfile
.
Path
(
str
(
SITE_PURELIB
/
"foo-0.1.0-py3.8.egg"
),
"EGG-INFO"
)
),
),
metadata
.
PathDistribution
(
VENDOR_DIR
/
"attrs-19.3.0.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"standard-1.2.3.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"standard-1.2.3.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"editable-2.3.4.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"editable-2.3.4.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"editable-with-import-2.3.4.dist-info"
),
metadata
.
PathDistribution
(
SITE_PURELIB
/
"editable-with-import-2.3.4.dist-info"
),
...
@@ -80,11 +78,6 @@ def mock_git_info(mocker: MockerFixture) -> None:
...
@@ -80,11 +78,6 @@ def mock_git_info(mocker: MockerFixture) -> None:
)
)
@pytest.fixture
(
autouse
=
True
)
def
mock_installed_repository_vendors
(
mocker
:
MockerFixture
)
->
None
:
mocker
.
patch
(
"poetry.repositories.installed_repository._VENDORS"
,
str
(
VENDOR_DIR
))
@pytest.fixture
@pytest.fixture
def
repository
(
mocker
:
MockerFixture
,
env
:
MockEnv
)
->
InstalledRepository
:
def
repository
(
mocker
:
MockerFixture
,
env
:
MockEnv
)
->
InstalledRepository
:
mocker
.
patch
(
mocker
.
patch
(
...
@@ -104,7 +97,7 @@ def get_package_from_repository(
...
@@ -104,7 +97,7 @@ def get_package_from_repository(
def
test_load_successful
(
repository
:
InstalledRepository
):
def
test_load_successful
(
repository
:
InstalledRepository
):
assert
len
(
repository
.
packages
)
==
len
(
INSTALLED_RESULTS
)
-
1
assert
len
(
repository
.
packages
)
==
len
(
INSTALLED_RESULTS
)
def
test_load_successful_with_invalid_distribution
(
def
test_load_successful_with_invalid_distribution
(
...
@@ -118,9 +111,7 @@ def test_load_successful_with_invalid_distribution(
...
@@ -118,9 +111,7 @@ def test_load_successful_with_invalid_distribution(
)
)
repository_with_invalid_distribution
=
InstalledRepository
.
load
(
env
)
repository_with_invalid_distribution
=
InstalledRepository
.
load
(
env
)
assert
(
assert
len
(
repository_with_invalid_distribution
.
packages
)
==
len
(
INSTALLED_RESULTS
)
len
(
repository_with_invalid_distribution
.
packages
)
==
len
(
INSTALLED_RESULTS
)
-
1
)
assert
len
(
caplog
.
messages
)
==
1
assert
len
(
caplog
.
messages
)
==
1
message
=
caplog
.
messages
[
0
]
message
=
caplog
.
messages
[
0
]
...
...
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