update deprecated warn(), py 3 strings, whitespace

tests all pass (eventually)
This commit is contained in:
Mark Mayo 2022-11-25 00:17:48 +11:00
parent a593d27e3d
commit 2728f2e7a4
3 changed files with 14 additions and 14 deletions

View File

@ -55,8 +55,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'pipreqs'
copyright = u'2015, Vadim Kravcenko'
project = 'pipreqs'
copyright = '2015, Vadim Kravcenko'
# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
@ -209,8 +209,8 @@ latex_elements = {
# [howto/manual]).
latex_documents = [
('index', 'pipreqs.tex',
u'pipreqs Documentation',
u'Vadim Kravcenko', 'manual'),
'pipreqs Documentation',
'Vadim Kravcenko', 'manual'),
]
# The name of an image file (relative to this directory) to place at
@ -240,8 +240,8 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'pipreqs',
u'pipreqs Documentation',
[u'Vadim Kravcenko'], 1)
'pipreqs Documentation',
['Vadim Kravcenko'], 1)
]
# If true, show URL addresses after external links.
@ -255,8 +255,8 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'pipreqs',
u'pipreqs Documentation',
u'Vadim Kravcenko',
'pipreqs Documentation',
'Vadim Kravcenko',
'pipreqs',
'One line description of project.',
'Miscellaneous'),

View File

@ -124,7 +124,7 @@ def get_all_imports(
except Exception as exc:
if ignore_errors:
traceback.print_exc(exc)
logging.warn("Failed on file: %s" % file_name)
logging.warning("Failed on file: %s" % file_name)
continue
else:
logging.error("Failed on file: %s" % file_name)
@ -206,7 +206,7 @@ def get_locally_installed_packages(encoding=None):
package = root.split(os.sep)[-1].split("-")
try:
package_import = f.read().strip().split("\n")
except: # NOQA
except Exception: # NOQA
# TODO: What errors do we intend to suppress here?
continue
for i_item in package_import:

View File

@ -145,7 +145,7 @@ class TestPipreqs(unittest.TestCase):
Test that we can save requirements.txt correctly
to a different path
"""
pipreqs.init({'<path>': self.project, '--savepath': self.alt_requirement_path,
pipreqs.init({'<path>': self.project, '--savepath': self.alt_requirement_path,
'--use-local': None, '--proxy':None, '--pypi-server':None, '--print': False,
'--diff': None, '--clean': None, '--mode': None})
assert os.path.exists(self.alt_requirement_path) == 1
@ -163,7 +163,7 @@ class TestPipreqs(unittest.TestCase):
"""
with open(self.requirements_path, "w") as f:
f.write("should_not_be_overwritten")
pipreqs.init({'<path>': self.project, '--savepath': None, '--use-local': None,
pipreqs.init({'<path>': self.project, '--savepath': None, '--use-local': None,
'--force': None, '--proxy':None, '--pypi-server':None, '--print': False,
'--diff': None, '--clean': None, '--mode': None})
assert os.path.exists(self.requirements_path) == 1
@ -203,7 +203,7 @@ class TestPipreqs(unittest.TestCase):
Test --ignore parameter
"""
pipreqs.init(
{'<path>': self.project_with_ignore_directory, '--savepath': None,
{'<path>': self.project_with_ignore_directory, '--savepath': None,
'--print': False, '--use-local': None, '--force': True,
'--proxy':None, '--pypi-server':None,
'--ignore':'.ignored_dir,.ignore_second',
@ -222,7 +222,7 @@ class TestPipreqs(unittest.TestCase):
Test --mode=no-pin
"""
pipreqs.init(
{'<path>': self.project_with_ignore_directory, '--savepath': None,
{'<path>': self.project_with_ignore_directory, '--savepath': None,
'--print': False, '--use-local': None, '--force': True,
'--proxy': None, '--pypi-server': None,
'--diff': None,