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
9c085a58
Commit
9c085a58
authored
Oct 16, 2020
by
Arjan Keeman
Committed by
finswimmer
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure editable builder generate valid scripts
parent
cb34c3d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
poetry/masonry/builders/editable.py
+1
-1
tests/fixtures/simple_project/pyproject.toml
+1
-0
tests/masonry/builders/test_editable_builder.py
+14
-2
No files found.
poetry/masonry/builders/editable.py
View file @
9c085a58
...
@@ -139,7 +139,7 @@ class EditableBuilder(Builder):
...
@@ -139,7 +139,7 @@ class EditableBuilder(Builder):
for
script
in
scripts
:
for
script
in
scripts
:
name
,
script
=
script
.
split
(
" = "
)
name
,
script
=
script
.
split
(
" = "
)
module
,
callable_
=
script
.
split
(
":"
)
module
,
callable_
=
script
.
split
(
":"
)
callable_holder
=
callable_
.
r
split
(
"."
,
1
)[
0
]
callable_holder
=
callable_
.
split
(
"."
,
1
)[
0
]
script_file
=
scripts_path
.
joinpath
(
name
)
script_file
=
scripts_path
.
joinpath
(
name
)
self
.
_debug
(
self
.
_debug
(
...
...
tests/fixtures/simple_project/pyproject.toml
View file @
9c085a58
...
@@ -27,3 +27,4 @@ python = "~2.7 || ^3.4"
...
@@ -27,3 +27,4 @@ python = "~2.7 || ^3.4"
[tool.poetry.scripts]
[tool.poetry.scripts]
foo
=
"foo:bar"
foo
=
"foo:bar"
baz
=
"bar:baz.boom.bim"
baz
=
"bar:baz.boom.bim"
fox
=
"fuz.foo:bar.baz"
tests/masonry/builders/test_editable_builder.py
View file @
9c085a58
...
@@ -92,7 +92,7 @@ def test_builder_installs_proper_files_for_standard_packages(simple_poetry, tmp_
...
@@ -92,7 +92,7 @@ def test_builder_installs_proper_files_for_standard_packages(simple_poetry, tmp_
assert
"poetry"
==
dist_info
.
joinpath
(
"INSTALLER"
)
.
read_text
()
assert
"poetry"
==
dist_info
.
joinpath
(
"INSTALLER"
)
.
read_text
()
assert
(
assert
(
"[console_scripts]
\n
baz=bar:baz.boom.bim
\n
foo=foo:bar
\n\n
"
"[console_scripts]
\n
baz=bar:baz.boom.bim
\n
foo=foo:bar
\n
fox=fuz.foo:bar.baz
\n
\n
"
==
dist_info
.
joinpath
(
"entry_points.txt"
)
.
read_text
()
==
dist_info
.
joinpath
(
"entry_points.txt"
)
.
read_text
()
)
)
...
@@ -140,7 +140,7 @@ My Package
...
@@ -140,7 +140,7 @@ My Package
baz_script
=
"""
\
baz_script
=
"""
\
#!{python}
#!{python}
from bar import baz
.boom
from bar import baz
if __name__ == '__main__':
if __name__ == '__main__':
baz.boom.bim()
baz.boom.bim()
...
@@ -162,6 +162,18 @@ if __name__ == '__main__':
...
@@ -162,6 +162,18 @@ if __name__ == '__main__':
assert
foo_script
==
tmp_venv
.
_bin_dir
.
joinpath
(
"foo"
)
.
read_text
()
assert
foo_script
==
tmp_venv
.
_bin_dir
.
joinpath
(
"foo"
)
.
read_text
()
fox_script
=
"""
\
#!{python}
from fuz.foo import bar
if __name__ == '__main__':
bar.baz()
"""
.
format
(
python
=
tmp_venv
.
_bin
(
"python"
)
)
assert
fox_script
==
tmp_venv
.
_bin_dir
.
joinpath
(
"fox"
)
.
read_text
()
def
test_builder_falls_back_on_setup_and_pip_for_packages_with_build_scripts
(
def
test_builder_falls_back_on_setup_and_pip_for_packages_with_build_scripts
(
extended_poetry
,
extended_poetry
,
...
...
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