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
15e24384
Unverified
Commit
15e24384
authored
Mar 06, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sdist package name
parent
aa426b75
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
poetry/masonry/builders/sdist.py
+3
-3
tests/masonry/builders/test_sdist.py
+31
-0
No files found.
poetry/masonry/builders/sdist.py
View file @
15e24384
...
...
@@ -56,14 +56,14 @@ class SdistBuilder(Builder):
if
not
target_dir
.
exists
():
target_dir
.
mkdir
(
parents
=
True
)
target
=
target_dir
/
f
'{self._package.name}'
\
f
'-{self._package.version}.tar.gz'
target
=
target_dir
/
f
'{self._package.
pretty_
name}'
\
f
'-{self._package.
pretty_
version}.tar.gz'
gz
=
GzipFile
(
target
.
as_posix
(),
mode
=
'wb'
)
tar
=
tarfile
.
TarFile
(
target
.
as_posix
(),
mode
=
'w'
,
fileobj
=
gz
,
format
=
tarfile
.
PAX_FORMAT
)
try
:
tar_dir
=
f
'{self._package.
name}-{self._package.
version}'
tar_dir
=
f
'{self._package.
pretty_name}-{self._package.pretty_
version}'
files_to_add
=
self
.
find_files_to_add
()
...
...
tests/masonry/builders/test_sdist.py
View file @
15e24384
import
ast
import
pytest
import
shutil
from
pathlib
import
Path
...
...
@@ -8,6 +10,24 @@ from poetry.masonry.builders.sdist import SdistBuilder
from
tests.helpers
import
get_dependency
fixtures_dir
=
Path
(
__file__
)
.
parent
/
'fixtures'
@pytest.fixture
(
autouse
=
True
)
def
setup
():
clear_samples_dist
()
yield
clear_samples_dist
()
def
clear_samples_dist
():
for
dist
in
fixtures_dir
.
glob
(
'**/dist'
):
if
dist
.
is_dir
():
shutil
.
rmtree
(
str
(
dist
))
def
project
(
name
):
return
Path
(
__file__
)
.
parent
/
'fixtures'
/
name
...
...
@@ -84,3 +104,14 @@ def test_find_files_to_add():
Path
(
'my_package/sub_pkg2/data2/data.json'
),
Path
(
'pyproject.toml'
),
]
def
test_package
():
poetry
=
Poetry
.
create
(
project
(
'complete'
))
builder
=
SdistBuilder
(
poetry
)
builder
.
build
()
sdist
=
fixtures_dir
/
'complete'
/
'dist'
/
'my-package-1.2.3.tar.gz'
assert
sdist
.
exists
()
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