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
d12f6421
Unverified
Commit
d12f6421
authored
Oct 24, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepare to move to the Poetry organization
parent
49a7a868
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
get-poetry.py
+13
-1
poetry/console/commands/self/update.py
+14
-3
No files found.
get-poetry.py
View file @
d12f6421
...
@@ -299,7 +299,9 @@ class Installer:
...
@@ -299,7 +299,9 @@ class Installer:
r"(?:\+[^\s]+)?"
r"(?:\+[^\s]+)?"
)
)
BASE_URL
=
"https://github.com/sdispater/poetry/releases/download/"
REPOSITORY_URL
=
"https://github.com/python-poetry/poetry"
BASE_URL
=
REPOSITORY_URL
+
"/releases/download/"
FALLBACK_BASE_URL
=
"https://github.com/sdispater/poetry/releases/download/"
def
__init__
(
def
__init__
(
self
,
self
,
...
@@ -849,6 +851,15 @@ def main():
...
@@ -849,6 +851,15 @@ def main():
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
base_url
=
Installer
.
BASE_URL
try
:
r
=
urlopen
(
Installer
.
REPOSITORY_URL
)
except
HTTPError
as
e
:
if
e
.
code
==
404
:
base_url
=
Installer
.
FALLBACK_BASE_URL
else
:
raise
installer
=
Installer
(
installer
=
Installer
(
version
=
args
.
version
or
os
.
getenv
(
"POETRY_VERSION"
),
version
=
args
.
version
or
os
.
getenv
(
"POETRY_VERSION"
),
preview
=
args
.
preview
or
string_to_bool
(
os
.
getenv
(
"POETRY_PREVIEW"
,
"0"
)),
preview
=
args
.
preview
or
string_to_bool
(
os
.
getenv
(
"POETRY_PREVIEW"
,
"0"
)),
...
@@ -856,6 +867,7 @@ def main():
...
@@ -856,6 +867,7 @@ def main():
accept_all
=
args
.
accept_all
accept_all
=
args
.
accept_all
or
string_to_bool
(
os
.
getenv
(
"POETRY_ACCEPT"
,
"0"
))
or
string_to_bool
(
os
.
getenv
(
"POETRY_ACCEPT"
,
"0"
))
or
not
is_interactive
(),
or
not
is_interactive
(),
base_url
=
base_url
,
)
)
if
args
.
uninstall
or
string_to_bool
(
os
.
getenv
(
"POETRY_UNINSTALL"
,
"0"
)):
if
args
.
uninstall
or
string_to_bool
(
os
.
getenv
(
"POETRY_UNINSTALL"
,
"0"
)):
...
...
poetry/console/commands/self/update.py
View file @
d12f6421
...
@@ -29,7 +29,9 @@ class SelfUpdateCommand(Command):
...
@@ -29,7 +29,9 @@ class SelfUpdateCommand(Command):
arguments
=
[
argument
(
"version"
,
"The version to update to."
,
optional
=
True
)]
arguments
=
[
argument
(
"version"
,
"The version to update to."
,
optional
=
True
)]
options
=
[
option
(
"preview"
,
None
,
"Install prereleases."
)]
options
=
[
option
(
"preview"
,
None
,
"Install prereleases."
)]
BASE_URL
=
"https://github.com/sdispater/poetry/releases/download"
REPOSITORY_URL
=
"https://github.com/python-poetry/poetry"
BASE_URL
=
REPOSITORY_URL
+
"/releases/download"
FALLBACK_BASE_URL
=
"https://github.com/sdispater/poetry/releases/download"
@property
@property
def
home
(
self
):
def
home
(
self
):
...
@@ -150,8 +152,17 @@ class SelfUpdateCommand(Command):
...
@@ -150,8 +152,17 @@ class SelfUpdateCommand(Command):
checksum
=
"poetry-{}-{}.sha256sum"
.
format
(
version
,
platform
)
checksum
=
"poetry-{}-{}.sha256sum"
.
format
(
version
,
platform
)
base_url
=
self
.
BASE_URL
try
:
try
:
r
=
urlopen
(
self
.
BASE_URL
+
"/{}/{}"
.
format
(
version
,
checksum
))
urlopen
(
self
.
REPOSITORY_URL
)
except
HTTPError
as
e
:
if
e
.
code
==
404
:
base_url
=
self
.
FALLBACK_BASE_URL
else
:
raise
try
:
r
=
urlopen
(
base_url
+
"/{}/{}"
.
format
(
version
,
checksum
))
except
HTTPError
as
e
:
except
HTTPError
as
e
:
if
e
.
code
==
404
:
if
e
.
code
==
404
:
raise
RuntimeError
(
"Could not find {} file"
.
format
(
checksum
))
raise
RuntimeError
(
"Could not find {} file"
.
format
(
checksum
))
...
@@ -163,7 +174,7 @@ class SelfUpdateCommand(Command):
...
@@ -163,7 +174,7 @@ class SelfUpdateCommand(Command):
# We get the payload from the remote host
# We get the payload from the remote host
name
=
"poetry-{}-{}.tar.gz"
.
format
(
version
,
platform
)
name
=
"poetry-{}-{}.tar.gz"
.
format
(
version
,
platform
)
try
:
try
:
r
=
urlopen
(
self
.
BASE_URL
+
"/{}/{}"
.
format
(
version
,
name
))
r
=
urlopen
(
base_url
+
"/{}/{}"
.
format
(
version
,
name
))
except
HTTPError
as
e
:
except
HTTPError
as
e
:
if
e
.
code
==
404
:
if
e
.
code
==
404
:
raise
RuntimeError
(
"Could not find {} file"
.
format
(
name
))
raise
RuntimeError
(
"Could not find {} file"
.
format
(
name
))
...
...
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