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
10c3d0d5
Unverified
Commit
10c3d0d5
authored
Sep 14, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve installer
parent
4490b68c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
get-poetry.py
+10
-3
No files found.
get-poetry.py
View file @
10c3d0d5
...
...
@@ -29,6 +29,7 @@ import sys
import
tarfile
import
tempfile
from
contextlib
import
closing
from
contextlib
import
contextmanager
from
functools
import
cmp_to_key
from
gzip
import
GzipFile
...
...
@@ -36,9 +37,11 @@ from io import UnsupportedOperation
try
:
from
urllib.error
import
HTTPError
from
urllib.request
import
Request
from
urllib.request
import
urlopen
except
ImportError
:
from
urllib2
import
HTTPError
from
urllib2
import
Request
from
urllib2
import
urlopen
try
:
...
...
@@ -329,9 +332,7 @@ class Installer:
def
get_version
(
self
):
print
(
colorize
(
"info"
,
"Retrieving Poetry metadata"
))
r
=
urlopen
(
self
.
METADATA_URL
)
metadata
=
json
.
loads
(
r
.
read
()
.
decode
())
r
.
close
()
metadata
=
json
.
loads
(
self
.
_get
(
self
.
METADATA_URL
))
def
_compare_versions
(
x
,
y
):
mx
=
self
.
VERSION_REGEX
.
match
(
x
)
...
...
@@ -775,6 +776,12 @@ class Installer:
def
call
(
self
,
*
args
):
return
subprocess
.
check_output
(
args
,
stderr
=
subprocess
.
STDOUT
)
def
_get
(
self
,
url
):
request
=
Request
(
url
,
headers
=
{
"User-Agent"
:
"Python Poetry"
})
with
closing
(
urlopen
(
request
))
as
r
:
return
r
.
read
()
def
main
():
parser
=
argparse
.
ArgumentParser
(
...
...
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