mirror of
https://github.com/bndr/pipreqs.git
synced 2025-07-21 01:10:01 +00:00
fixed lint warnings
This commit is contained in:
parent
a4e7cbc772
commit
061a9b5f64
@ -95,7 +95,7 @@ def get_imports_info(imports, pypi_server="https://pypi.python.org/pypi/", proxy
|
|||||||
data = json2package(response.content)
|
data = json2package(response.content)
|
||||||
elif response.status_code >= 300:
|
elif response.status_code >= 300:
|
||||||
raise HTTPError(status_code=response.status_code,
|
raise HTTPError(status_code=response.status_code,
|
||||||
reason=response.reason)
|
reason=response.reason)
|
||||||
except HTTPError:
|
except HTTPError:
|
||||||
logging.debug(
|
logging.debug(
|
||||||
'Package %s does not exist or network problems', item)
|
'Package %s does not exist or network problems', item)
|
||||||
@ -173,7 +173,7 @@ def init(args):
|
|||||||
pypi_server = args["--pypi-server"]
|
pypi_server = args["--pypi-server"]
|
||||||
|
|
||||||
if args["--proxy"]:
|
if args["--proxy"]:
|
||||||
proxy = {'http':args["--proxy"], 'https':args["--proxy"]}
|
proxy = {'http': args["--proxy"], 'https': args["--proxy"]}
|
||||||
|
|
||||||
if args["--use-local"]:
|
if args["--use-local"]:
|
||||||
logging.debug(
|
logging.debug(
|
||||||
@ -192,7 +192,6 @@ def init(args):
|
|||||||
path = (args["--savepath"] if args["--savepath"] else
|
path = (args["--savepath"] if args["--savepath"] else
|
||||||
os.path.join(args['<path>'], "requirements.txt"))
|
os.path.join(args['<path>'], "requirements.txt"))
|
||||||
|
|
||||||
|
|
||||||
if not args["--savepath"] and not args["--force"] and os.path.exists(path):
|
if not args["--savepath"] and not args["--force"] and os.path.exists(path):
|
||||||
logging.warning("Requirements.txt already exists, "
|
logging.warning("Requirements.txt already exists, "
|
||||||
"use --force to overwrite it")
|
"use --force to overwrite it")
|
||||||
|
@ -105,11 +105,9 @@ class TestPipreqs(unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
import_name_without_aliases, expected_import_name_without_alias)
|
import_name_without_aliases, expected_import_name_without_alias)
|
||||||
|
|
||||||
|
|
||||||
def test_custom_pypi_server(self):
|
def test_custom_pypi_server(self):
|
||||||
self.assertRaises(requests.exceptions.MissingSchema, pipreqs.init, {'<path>': self.project, '--savepath': None,
|
self.assertRaises(requests.exceptions.MissingSchema, pipreqs.init, {'<path>': self.project, '--savepath': None,
|
||||||
'--use-local': None, '--force': True, '--proxy':None, '--pypi-server':'nonexistent'})
|
'--use-local': None, '--force': True, '--proxy': None, '--pypi-server': 'nonexistent'})
|
||||||
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user