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
b546a1b3
Unverified
Commit
b546a1b3
authored
Oct 08, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix duplicate entries in sdist and wheel
parent
99b4da0c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
4 deletions
+18
-4
CHANGELOG.md
+1
-0
poetry/masonry/builders/builder.py
+4
-1
poetry/masonry/builders/sdist.py
+5
-2
poetry/masonry/builders/wheel.py
+4
-1
tests/masonry/builders/fixtures/with-include/pyproject.toml
+1
-0
tests/masonry/builders/test_sdist.py
+1
-0
tests/masonry/builders/test_wheel.py
+1
-0
tests/test_poetry.py
+1
-0
No files found.
CHANGELOG.md
View file @
b546a1b3
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
-
Fixed a memory leak in the resolver.
-
Fixed a memory leak in the resolver.
-
Fixed a recursion error on duplicate dependencies with only different extras.
-
Fixed a recursion error on duplicate dependencies with only different extras.
-
Fixed handling of extras.
-
Fixed handling of extras.
-
Fixed duplicate entries in both sdist and wheel.
## [0.11.5] - 2018-09-04
## [0.11.5] - 2018-09-04
...
...
poetry/masonry/builders/builder.py
View file @
b546a1b3
...
@@ -68,7 +68,6 @@ class Builder(object):
...
@@ -68,7 +68,6 @@ class Builder(object):
Finds all files to add to the tarball
Finds all files to add to the tarball
"""
"""
excluded
=
self
.
find_excluded_files
()
excluded
=
self
.
find_excluded_files
()
src
=
self
.
_module
.
path
to_add
=
[]
to_add
=
[]
for
include
in
self
.
_module
.
includes
:
for
include
in
self
.
_module
.
includes
:
...
@@ -87,6 +86,10 @@ class Builder(object):
...
@@ -87,6 +86,10 @@ class Builder(object):
if
file
.
suffix
==
".pyc"
:
if
file
.
suffix
==
".pyc"
:
continue
continue
if
file
in
to_add
:
# Skip duplicates
continue
self
.
_io
.
writeln
(
self
.
_io
.
writeln
(
" - Adding: <comment>{}</comment>"
.
format
(
str
(
file
)),
" - Adding: <comment>{}</comment>"
.
format
(
str
(
file
)),
verbosity
=
self
.
_io
.
VERBOSITY_VERY_VERBOSE
,
verbosity
=
self
.
_io
.
VERBOSITY_VERY_VERBOSE
,
...
...
poetry/masonry/builders/sdist.py
View file @
b546a1b3
...
@@ -129,13 +129,16 @@ class SdistBuilder(Builder):
...
@@ -129,13 +129,16 @@ class SdistBuilder(Builder):
if
pkg_dir
is
not
None
:
if
pkg_dir
is
not
None
:
package_dir
[
""
]
=
os
.
path
.
relpath
(
pkg_dir
,
str
(
self
.
_path
))
package_dir
[
""
]
=
os
.
path
.
relpath
(
pkg_dir
,
str
(
self
.
_path
))
packages
+=
_packages
packages
+=
[
p
for
p
in
_packages
if
p
not
in
packages
]
package_data
.
update
(
_package_data
)
package_data
.
update
(
_package_data
)
else
:
else
:
if
include
.
source
is
not
None
:
if
include
.
source
is
not
None
:
package_dir
[
""
]
=
str
(
include
.
base
.
relative_to
(
self
.
_path
))
package_dir
[
""
]
=
str
(
include
.
base
.
relative_to
(
self
.
_path
))
modules
.
append
(
include
.
elements
[
0
]
.
relative_to
(
include
.
base
)
.
stem
)
module
=
include
.
elements
[
0
]
.
relative_to
(
include
.
base
)
.
stem
if
module
not
in
modules
:
modules
.
append
(
module
)
else
:
else
:
pass
pass
...
...
poetry/masonry/builders/wheel.py
View file @
b546a1b3
...
@@ -109,7 +109,6 @@ class WheelBuilder(Builder):
...
@@ -109,7 +109,6 @@ class WheelBuilder(Builder):
def
_copy_module
(
self
,
wheel
):
def
_copy_module
(
self
,
wheel
):
excluded
=
self
.
find_excluded_files
()
excluded
=
self
.
find_excluded_files
()
src
=
self
.
_module
.
path
to_add
=
[]
to_add
=
[]
for
include
in
self
.
_module
.
includes
:
for
include
in
self
.
_module
.
includes
:
...
@@ -133,6 +132,10 @@ class WheelBuilder(Builder):
...
@@ -133,6 +132,10 @@ class WheelBuilder(Builder):
if
file
.
suffix
==
".pyc"
:
if
file
.
suffix
==
".pyc"
:
continue
continue
if
(
file
,
rel_file
)
in
to_add
:
# Skip duplicates
continue
self
.
_io
.
writeln
(
self
.
_io
.
writeln
(
" - Adding: <comment>{}</comment>"
.
format
(
str
(
file
)),
" - Adding: <comment>{}</comment>"
.
format
(
str
(
file
)),
verbosity
=
self
.
_io
.
VERBOSITY_VERY_VERBOSE
,
verbosity
=
self
.
_io
.
VERBOSITY_VERY_VERBOSE
,
...
...
tests/masonry/builders/fixtures/with-include/pyproject.toml
View file @
b546a1b3
...
@@ -22,6 +22,7 @@ classifiers = [
...
@@ -22,6 +22,7 @@ classifiers = [
packages
=
[
packages
=
[
{
include
=
"extra_dir/**/*.py"
}
,
{
include
=
"extra_dir/**/*.py"
}
,
{
include
=
"extra_dir/**/*.py"
}
,
{
include
=
"my_module.py"
}
,
{
include
=
"my_module.py"
}
,
{
include
=
"package_with_include"
}
,
{
include
=
"package_with_include"
}
,
]
]
...
...
tests/masonry/builders/test_sdist.py
View file @
b546a1b3
...
@@ -416,6 +416,7 @@ def test_package_with_include(mocker):
...
@@ -416,6 +416,7 @@ def test_package_with_include(mocker):
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
names
=
tar
.
getnames
()
names
=
tar
.
getnames
()
assert
len
(
names
)
==
len
(
set
(
names
))
assert
"with-include-1.2.3/LICENSE"
in
names
assert
"with-include-1.2.3/LICENSE"
in
names
assert
"with-include-1.2.3/README.rst"
in
names
assert
"with-include-1.2.3/README.rst"
in
names
assert
"with-include-1.2.3/extra_dir/__init__.py"
in
names
assert
"with-include-1.2.3/extra_dir/__init__.py"
in
names
...
...
tests/masonry/builders/test_wheel.py
View file @
b546a1b3
...
@@ -114,6 +114,7 @@ def test_package_with_include(mocker):
...
@@ -114,6 +114,7 @@ def test_package_with_include(mocker):
with
zipfile
.
ZipFile
(
str
(
whl
))
as
z
:
with
zipfile
.
ZipFile
(
str
(
whl
))
as
z
:
names
=
z
.
namelist
()
names
=
z
.
namelist
()
assert
len
(
names
)
==
len
(
set
(
names
))
assert
"with_include-1.2.3.dist-info/LICENSE"
in
names
assert
"with_include-1.2.3.dist-info/LICENSE"
in
names
assert
"extra_dir/__init__.py"
in
names
assert
"extra_dir/__init__.py"
in
names
assert
"extra_dir/vcs_excluded.txt"
in
names
assert
"extra_dir/vcs_excluded.txt"
in
names
...
...
tests/test_poetry.py
View file @
b546a1b3
...
@@ -116,6 +116,7 @@ def test_poetry_with_packages_and_includes():
...
@@ -116,6 +116,7 @@ def test_poetry_with_packages_and_includes():
assert
package
.
packages
==
[
assert
package
.
packages
==
[
{
"include"
:
"extra_dir/**/*.py"
},
{
"include"
:
"extra_dir/**/*.py"
},
{
"include"
:
"extra_dir/**/*.py"
},
{
"include"
:
"my_module.py"
},
{
"include"
:
"my_module.py"
},
{
"include"
:
"package_with_include"
},
{
"include"
:
"package_with_include"
},
]
]
...
...
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