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
1dd12f7d
Unverified
Commit
1dd12f7d
authored
May 21, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
parents
1cabc09f
0667c67a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
poetry/console/commands/script.py
+16
-2
No files found.
poetry/console/commands/script.py
View file @
1dd12f7d
import
sys
from
...masonry.utils.module
import
Module
from
.venv_command
import
VenvCommand
...
...
@@ -25,19 +26,32 @@ class ScriptCommand(VenvCommand):
module
,
callable_
=
scripts
[
script
]
.
split
(
':'
)
src_in_sys_path
=
'sys.path.append(
\'
src
\'
); '
\
if
self
.
_module
.
is_in_src
()
else
''
cmd
=
[
'python'
,
'-c'
]
cmd
+=
[
'"import sys; '
'from importlib import import_module; '
'sys.argv = {!r}; '
'sys.argv = {!r};
{}
'
'import_module(
\'
{}
\'
).{}()"'
.
format
(
argv
,
module
,
callable_
argv
,
src_in_sys_path
,
module
,
callable_
)
]
self
.
venv
.
run
(
*
cmd
,
shell
=
True
,
call
=
True
)
@property
def
_module
(
self
):
poetry
=
self
.
poetry
package
=
poetry
.
package
path
=
poetry
.
file
.
parent
module
=
Module
(
package
.
name
,
path
.
as_posix
()
)
return
module
def
merge_application_definition
(
self
,
merge_args
=
True
):
if
self
.
_application
is
None
\
or
(
self
.
_application_definition_merged
...
...
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