Skip to content

Commit d05613a

Browse files
committed
Apply cosmetic code formatting adn refactoring
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent c718d19 commit d05613a

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

src/python_inspector/setup_py_live_eval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
def minver_error(pkg_name):
3030
"""Report error about missing minimum version constraint and exit."""
3131
print(
32-
'ERROR: specify minimal version of "{0}" using ' '">=" or "=="'.format(pkg_name),
32+
'ERROR: specify minimal version of "{0}" using ">=" or "=="'.format(pkg_name),
3333
file=sys.stderr,
3434
)
3535
sys.exit(1)
@@ -164,7 +164,7 @@ def iter_requirements(level, extras, setup_file):
164164
specs = {s.operator: s.version for s in specs._specs}
165165
if ((">=" in specs) and (">" in specs)) or (("<=" in specs) and ("<" in specs)):
166166
print(
167-
"ERROR: Do not specify such weird constraints! " '("{0}")'.format(pkg),
167+
'ERROR: Do not specify such weird constraints! ("{0}")'.format(pkg),
168168
file=sys.stderr,
169169
)
170170
sys.exit(1)

src/python_inspector/utils_pip_compatibility_tags.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"""Generate and work with PEP 425 Compatibility Tags.
1+
"""
2+
Generate and work with PEP 425 Compatibility Tags.
23
34
copied from pip-20.3.1 pip/_internal/utils/compatibility_tags.py
45
download_url: https://github.com/pypa/pip/blob/20.3.1/src/pip/_internal/utils/compatibility_tags.py
@@ -141,7 +142,8 @@ def get_supported(
141142
abis=None, # type: Optional[List[str]]
142143
):
143144
# type: (...) -> List[Tag]
144-
"""Return a list of supported tags for each version specified in
145+
"""
146+
Return a list of supported tags for each version specified in
145147
`versions`.
146148
147149
:param version: a string version, of the form "33" or "32",

src/python_inspector/utils_pypi.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ class Link(NamedTuple):
433433

434434
@attr.attributes
435435
class Distribution(NameVer):
436-
437436
"""
438437
A Distribution is either either a Wheel or Sdist and is identified by and
439438
created from its filename as well as its name and version. A Distribution is
@@ -1005,7 +1004,6 @@ def to_filename(self):
10051004

10061005
@attr.attributes
10071006
class Wheel(Distribution):
1008-
10091007
"""
10101008
Represents a wheel file.
10111009

tests/test_codestyle.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
class BaseTests(unittest.TestCase):
1818
@pytest.mark.skipif(sys.version_info[:2] == (3, 12), reason="Skipping test for Python 3.12")
1919
def test_codestyle(self):
20-
"""
21-
This test shouldn't run in proliferated repositories.
22-
"""
23-
args = "make check"
20+
args = ["make", "check"]
2421
try:
25-
subprocess.check_output(args.split())
22+
subprocess.check_output(args)
2623
except subprocess.CalledProcessError as e:
2724
print("===========================================================")
2825
print(e.output)

tests/test_setup_py_live_eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# file for more details.
99
#
1010
"""Tests for `requirements-builder` module."""
11+
1112
from os.path import abspath
1213
from os.path import dirname
1314
from os.path import join

tests/test_utils_pip_compatibility_tags.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"""Generate and work with PEP 425 Compatibility Tags.
1+
"""
2+
Generate and work with PEP 425 Compatibility Tags.
23
34
copied from pip-20.3.1 pip/tests/unit/test_utils_compatibility_tags.py
45
download_url: https://raw.githubusercontent.com/pypa/pip/20.3.1/tests/unit/test_utils_compatibility_tags.py

0 commit comments

Comments
 (0)