Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
7c34463b
Commit
7c34463b
authored
Aug 31, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Plain Diff
Merge update to ez_setup.py
parents
902eeb8f
0424d558
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
CHANGES.txt
CHANGES.txt
+7
-0
CONTRIBUTORS.txt
CONTRIBUTORS.txt
+1
-0
ez_setup.py
ez_setup.py
+13
-3
No files found.
CHANGES.txt
View file @
7c34463b
...
...
@@ -2,6 +2,13 @@
CHANGES
=======
----
next
----
* Issue #75: Add ``--insecure`` option to ez_setup.py to accommodate
environments where a trusted SSL connection cannot be validated.
---
1.1
---
...
...
CONTRIBUTORS.txt
View file @
7c34463b
...
...
@@ -21,6 +21,7 @@ Contributors
* Marc Abramowitz
* Martin von Löwis
* Noufal Ibrahim
* Pedro Algarvio
* Pete Hollobon
* Phillip J. Eby
* Philip Jenvey
...
...
ez_setup.py
View file @
7c34463b
...
...
@@ -254,7 +254,8 @@ def get_best_downloader():
return
dl
def
download_setuptools
(
version
=
DEFAULT_VERSION
,
download_base
=
DEFAULT_URL
,
to_dir
=
os
.
curdir
,
delay
=
15
):
to_dir
=
os
.
curdir
,
delay
=
15
,
downloader_factory
=
get_best_downloader
):
"""Download setuptools from a specified location and return its filename
`version` should be a valid setuptools version number that is available
...
...
@@ -262,6 +263,9 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
with a '/'). `to_dir` is the directory where the egg will be downloaded.
`delay` is the number of seconds to pause before an actual download
attempt.
``downloader_factory`` should be a function taking no arguments and
returning a function for downloading a URL to a target.
"""
# making sure we use the absolute path
to_dir
=
os
.
path
.
abspath
(
to_dir
)
...
...
@@ -270,7 +274,7 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
saveto
=
os
.
path
.
join
(
to_dir
,
tgz_name
)
if
not
os
.
path
.
exists
(
saveto
):
# Avoid repeated downloads
log
.
warn
(
"Downloading %s"
,
url
)
downloader
=
get_best_downloader
()
downloader
=
downloader_factory
()
downloader
(
url
,
saveto
)
return
os
.
path
.
realpath
(
saveto
)
...
...
@@ -346,6 +350,11 @@ def _parse_args():
'--download-base'
,
dest
=
'download_base'
,
metavar
=
"URL"
,
default
=
DEFAULT_URL
,
help
=
'alternative URL from where to download the setuptools package'
)
parser
.
add_option
(
'--insecure'
,
dest
=
'downloader_factory'
,
action
=
'store_const'
,
const
=
lambda
:
download_file_insecure
,
default
=
get_best_downloader
,
help
=
'Use internal, non-validating downloader'
)
options
,
args
=
parser
.
parse_args
()
# positional arguments are ignored
return
options
...
...
@@ -353,7 +362,8 @@ def _parse_args():
def
main
(
version
=
DEFAULT_VERSION
):
"""Install or upgrade setuptools and EasyInstall"""
options
=
_parse_args
()
tarball
=
download_setuptools
(
download_base
=
options
.
download_base
)
tarball
=
download_setuptools
(
download_base
=
options
.
download_base
,
downloader_factory
=
options
.
downloader_factory
)
return
_install
(
tarball
,
_build_install_args
(
options
))
if
__name__
==
'__main__'
:
...
...
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