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
e403ff46
Unverified
Commit
e403ff46
authored
Feb 28, 2022
by
Branch Vincent
Committed by
GitHub
Feb 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(show): handle missing lockfile (#5242)
parent
da9680b0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
src/poetry/console/commands/show.py
+7
-0
tests/console/commands/test_show.py
+10
-0
No files found.
src/poetry/console/commands/show.py
View file @
e403ff46
...
@@ -129,6 +129,13 @@ lists all packages available."""
...
@@ -129,6 +129,13 @@ lists all packages available."""
if
self
.
option
(
"default"
):
if
self
.
option
(
"default"
):
only_groups
.
append
(
"default"
)
only_groups
.
append
(
"default"
)
if
not
self
.
poetry
.
locker
.
is_locked
():
self
.
line_error
(
"<error>Error: poetry.lock not found. Run `poetry lock` to create"
" it.</error>"
)
return
1
locked_repo
=
self
.
poetry
.
locker
.
locked_repository
(
True
)
locked_repo
=
self
.
poetry
.
locker
.
locked_repository
(
True
)
if
only_groups
:
if
only_groups
:
...
...
tests/console/commands/test_show.py
View file @
e403ff46
...
@@ -1587,3 +1587,13 @@ required by
...
@@ -1587,3 +1587,13 @@ required by
"""
.
splitlines
()
"""
.
splitlines
()
actual
=
[
line
.
rstrip
()
for
line
in
tester
.
io
.
fetch_output
()
.
splitlines
()]
actual
=
[
line
.
rstrip
()
for
line
in
tester
.
io
.
fetch_output
()
.
splitlines
()]
assert
actual
==
expected
assert
actual
==
expected
def
test_show_errors_without_lock_file
(
tester
:
"CommandTester"
,
poetry
:
"Poetry"
):
assert
not
poetry
.
locker
.
lock
.
exists
()
tester
.
execute
()
expected
=
"Error: poetry.lock not found. Run `poetry lock` to create it.
\n
"
assert
tester
.
io
.
fetch_error
()
==
expected
assert
tester
.
status_code
==
1
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