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
043b9ec9
Unverified
Commit
043b9ec9
authored
May 31, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix self:update command
parent
994505df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
CHANGELOG.md
+8
-0
poetry/console/commands/self/update.py
+17
-9
No files found.
CHANGELOG.md
View file @
043b9ec9
# Change Log
# Change Log
## [Unreleased]
### Fixed
-
Fixed
`self:update`
command on Windows.
-
Fixed
`self:update`
not picking up new versions.
## [0.10.2] - 2018-05-31
## [0.10.2] - 2018-05-31
### Fixed
### Fixed
...
...
poetry/console/commands/self/update.py
View file @
043b9ec9
...
@@ -22,6 +22,8 @@ class SelfUpdateCommand(Command):
...
@@ -22,6 +22,8 @@ class SelfUpdateCommand(Command):
def
handle
(
self
):
def
handle
(
self
):
from
poetry.__version__
import
__version__
from
poetry.__version__
import
__version__
from
poetry.repositories.pypi_repository
import
PyPiRepository
from
poetry.repositories.pypi_repository
import
PyPiRepository
from
poetry.semver
import
Version
from
poetry.utils._compat
import
decode
version
=
self
.
argument
(
"version"
)
version
=
self
.
argument
(
"version"
)
if
not
version
:
if
not
version
:
...
@@ -44,7 +46,7 @@ class SelfUpdateCommand(Command):
...
@@ -44,7 +46,7 @@ class SelfUpdateCommand(Command):
)
)
release
=
None
release
=
None
for
package
in
reversed
(
packages
)
:
for
package
in
packages
:
if
package
.
is_prerelease
():
if
package
.
is_prerelease
():
if
self
.
option
(
"preview"
):
if
self
.
option
(
"preview"
):
release
=
package
release
=
package
...
@@ -61,7 +63,7 @@ class SelfUpdateCommand(Command):
...
@@ -61,7 +63,7 @@ class SelfUpdateCommand(Command):
self
.
line
(
"No new release found"
)
self
.
line
(
"No new release found"
)
return
return
if
release
.
version
==
__version__
:
if
release
.
version
==
Version
.
parse
(
__version__
)
:
self
.
line
(
"You are using the latest version"
)
self
.
line
(
"You are using the latest version"
)
return
return
...
@@ -73,7 +75,7 @@ class SelfUpdateCommand(Command):
...
@@ -73,7 +75,7 @@ class SelfUpdateCommand(Command):
[
[
"[CalledProcessError]"
,
"[CalledProcessError]"
,
"An error has occured: {}"
.
format
(
str
(
e
)),
"An error has occured: {}"
.
format
(
str
(
e
)),
e
.
output
,
decode
(
e
.
output
)
,
],
],
style
=
"error"
,
style
=
"error"
,
)
)
...
@@ -91,19 +93,19 @@ class SelfUpdateCommand(Command):
...
@@ -91,19 +93,19 @@ class SelfUpdateCommand(Command):
base_prefix
=
getattr
(
sys
,
"base_prefix"
,
None
)
base_prefix
=
getattr
(
sys
,
"base_prefix"
,
None
)
real_prefix
=
getattr
(
sys
,
"real_prefix"
,
None
)
real_prefix
=
getattr
(
sys
,
"real_prefix"
,
None
)
prefix_poetry
=
Path
(
prefix
)
/
"bin"
/
"poetry"
prefix_poetry
=
self
.
_bin_path
(
Path
(
prefix
),
"poetry"
)
if
prefix_poetry
.
exists
():
if
prefix_poetry
.
exists
():
pip
=
(
prefix_poetry
.
parent
/
"pip"
)
.
resolve
()
pip
=
self
.
_bin_path
(
prefix_poetry
.
parent
.
parent
,
"pip"
)
.
resolve
()
elif
(
elif
(
base_prefix
base_prefix
and
base_prefix
!=
prefix
and
base_prefix
!=
prefix
and
(
Path
(
base_prefix
)
/
"bin"
/
"poetry"
)
.
exists
()
and
self
.
_bin_path
(
Path
(
base_prefix
),
"poetry"
)
.
exists
()
):
):
pip
=
Path
(
base_prefix
)
/
"bin"
/
"pip"
pip
=
self
.
_bin_path
(
Path
(
base_prefix
),
"pip"
)
elif
real_prefix
:
elif
real_prefix
:
pip
=
Path
(
real_prefix
)
/
"bin"
/
"pip"
pip
=
self
.
_bin_path
(
Path
(
real_prefix
),
"pip"
)
else
:
else
:
pip
=
Path
(
prefix
)
/
"bin"
/
"pip"
pip
=
self
.
_bin_path
(
Path
(
prefix
),
"pip"
)
if
not
pip
.
exists
():
if
not
pip
.
exists
():
raise
RuntimeError
(
"Unable to determine poetry's path"
)
raise
RuntimeError
(
"Unable to determine poetry's path"
)
...
@@ -176,3 +178,9 @@ class SelfUpdateCommand(Command):
...
@@ -176,3 +178,9 @@ class SelfUpdateCommand(Command):
def
process
(
self
,
*
args
):
def
process
(
self
,
*
args
):
return
subprocess
.
check_output
(
list
(
args
),
stderr
=
subprocess
.
STDOUT
)
return
subprocess
.
check_output
(
list
(
args
),
stderr
=
subprocess
.
STDOUT
)
def
_bin_path
(
self
,
base_path
,
bin
):
if
sys
.
platform
==
"win32"
:
return
(
base_path
/
"Scripts"
/
bin
)
.
with_suffix
(
".exe"
)
return
base_path
/
"bin"
/
bin
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