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
2dc26715
Unverified
Commit
2dc26715
authored
Nov 13, 2019
by
Sébastien Eustace
Committed by
GitHub
Nov 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix support for egg files in InstalledRepository (#1577)
parent
ad40e5bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
.gitignore
+1
-0
poetry/repositories/installed_repository.py
+1
-1
tests/repositories/fixtures/installed/lib/python3.7/site-packages/foo-0.1.0-py3.8.egg
+0
-0
tests/repositories/test_installed_repository.py
+9
-2
No files found.
.gitignore
View file @
2dc26715
...
...
@@ -2,6 +2,7 @@
# Packages
*.egg
!/tests/**/*.egg
/*.egg-info
/tests/fixtures/**/*.egg-info
/dist/*
...
...
poetry/repositories/installed_repository.py
View file @
2dc26715
...
...
@@ -27,7 +27,7 @@ class InstalledRepository(Repository):
repo
.
add_package
(
package
)
path
=
Path
(
distribution
.
_path
)
path
=
Path
(
str
(
distribution
.
_path
)
)
is_standard_package
=
True
try
:
path
.
relative_to
(
env
.
site_packages
)
...
...
tests/repositories/fixtures/installed/lib/python3.7/site-packages/foo-0.1.0-py3.8.egg
0 → 100644
View file @
2dc26715
File added
tests/repositories/test_installed_repository.py
View file @
2dc26715
import
zipp
from
importlib_metadata
import
PathDistribution
from
poetry.repositories.installed_repository
import
InstalledRepository
from
poetry.utils._compat
import
Path
...
...
@@ -11,6 +13,7 @@ SRC = ENV_DIR / "src"
INSTALLED_RESULTS
=
[
PathDistribution
(
SITE_PACKAGES
/
"cleo-0.7.6.dist-info"
),
PathDistribution
(
SRC
/
"pendulum"
/
"pendulum.egg-info"
),
PathDistribution
(
zipp
.
Path
(
str
(
SITE_PACKAGES
/
"foo-0.1.0-py3.8.egg"
),
"EGG-INFO"
)),
]
...
...
@@ -37,7 +40,7 @@ def test_load(mocker):
)
repository
=
InstalledRepository
.
load
(
MockEnv
(
path
=
ENV_DIR
))
assert
len
(
repository
.
packages
)
==
2
assert
len
(
repository
.
packages
)
==
3
cleo
=
repository
.
packages
[
0
]
assert
cleo
.
name
==
"cleo"
...
...
@@ -47,7 +50,11 @@ def test_load(mocker):
==
"Cleo allows you to create beautiful and testable command-line interfaces."
)
pendulum
=
repository
.
packages
[
1
]
foo
=
repository
.
packages
[
1
]
assert
foo
.
name
==
"foo"
assert
foo
.
version
.
text
==
"0.1.0"
pendulum
=
repository
.
packages
[
2
]
assert
pendulum
.
name
==
"pendulum"
assert
pendulum
.
version
.
text
==
"2.0.5"
assert
pendulum
.
description
==
"Python datetimes made easy"
...
...
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