mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-07 03:55:22 +00:00
Fix 227
This commit is contained in:
parent
be812e4884
commit
e174f9ca1a
5
.gitignore
vendored
5
.gitignore
vendored
@ -52,7 +52,4 @@ Session.vim
|
|||||||
.netrwhist
|
.netrwhist
|
||||||
*~
|
*~
|
||||||
|
|
||||||
/pipreqs/*.bak
|
/pipreqs/*.bak
|
||||||
.vscode/settings.json
|
|
||||||
.gitignore
|
|
||||||
|
|
@ -19,7 +19,8 @@ Options:
|
|||||||
parameter in your terminal:
|
parameter in your terminal:
|
||||||
$ export HTTP_PROXY="http://10.10.1.10:3128"
|
$ export HTTP_PROXY="http://10.10.1.10:3128"
|
||||||
$ export HTTPS_PROXY="https://10.10.1.10:1080"
|
$ export HTTPS_PROXY="https://10.10.1.10:1080"
|
||||||
--trusted-host Ignore SSL warnings, recommended using with enterprise proxy.
|
--trusted-host Ignore SSL warnings, recommended using with
|
||||||
|
enterprise proxy.
|
||||||
--debug Print debug information.
|
--debug Print debug information.
|
||||||
--ignore <dirs>... Ignore extra directories, each separated by a comma.
|
--ignore <dirs>... Ignore extra directories, each separated by a comma.
|
||||||
--no-follow-links Do not follow symbolic links in the project
|
--no-follow-links Do not follow symbolic links in the project
|
||||||
@ -182,13 +183,15 @@ def output_requirements(imports):
|
|||||||
|
|
||||||
|
|
||||||
def get_imports_info(
|
def get_imports_info(
|
||||||
imports, pypi_server="https://pypi.python.org/pypi/", proxy=None, verify_ssl=True):
|
imports, pypi_server="https://pypi.python.org/pypi/", proxy=None,
|
||||||
|
verify_ssl=True):
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
for item in imports:
|
for item in imports:
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"{0}{1}/json".format(pypi_server, item), proxies=proxy, verify=verify_ssl)
|
"{0}{1}/json".format(pypi_server, item), proxies=proxy,
|
||||||
|
verify=verify_ssl)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
if hasattr(response.content, 'decode'):
|
if hasattr(response.content, 'decode'):
|
||||||
data = json2package(response.content.decode())
|
data = json2package(response.content.decode())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user