diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0621f5171..5224ce6ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: check-docstring-first - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black diff --git a/tests/masonry/builders/test_builder.py b/tests/masonry/builders/test_builder.py index e0f673626..1c2922c00 100644 --- a/tests/masonry/builders/test_builder.py +++ b/tests/masonry/builders/test_builder.py @@ -185,8 +185,7 @@ def test_metadata_with_url_dependencies() -> None: requires_dist = metadata["Requires-Dist"] assert ( - requires_dist - == "demo @" + requires_dist == "demo @" " https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl" ) diff --git a/tests/masonry/builders/test_complete.py b/tests/masonry/builders/test_complete.py index 3af88074c..649e196a5 100644 --- a/tests/masonry/builders/test_complete.py +++ b/tests/masonry/builders/test_complete.py @@ -155,24 +155,32 @@ def test_complete(no_vcs: bool) -> None: entry_points = zipf.read("my_package-1.2.3.dist-info/entry_points.txt") - assert entry_points.decode() == """\ + assert ( + entry_points.decode() + == """\ [console_scripts] extra-script=my_package.extra:main[time] my-2nd-script=my_package:main2 my-script=my_package:main """ + ) wheel_data = zipf.read("my_package-1.2.3.dist-info/WHEEL").decode() - assert wheel_data == f"""\ + assert ( + wheel_data + == f"""\ Wheel-Version: 1.0 Generator: poetry-core {__version__} Root-Is-Purelib: true Tag: py3-none-any """ + ) wheel_data = zipf.read("my_package-1.2.3.dist-info/METADATA").decode() - assert wheel_data == """\ + assert ( + wheel_data + == """\ Metadata-Version: 2.1 Name: my-package Version: 1.2.3 @@ -210,6 +218,7 @@ def test_complete(no_vcs: bool) -> None: ========== """ + ) actual_records = zipf.read("my_package-1.2.3.dist-info/RECORD").decode() # The SHA hashes vary per operating systems. diff --git a/tests/packages/test_dependency.py b/tests/packages/test_dependency.py index 43deb823f..eb134f4ee 100644 --- a/tests/packages/test_dependency.py +++ b/tests/packages/test_dependency.py @@ -45,8 +45,7 @@ def test_to_pep_508() -> None: result = dependency.to_pep_508() assert ( - result - == "Django (>=1.23,<2.0) ; " + result == "Django (>=1.23,<2.0) ; " 'python_version >= "2.7" and python_version < "2.8" ' 'or python_version >= "3.6" and python_version < "4.0"' ) @@ -78,8 +77,7 @@ def test_to_pep_508_in_extras() -> None: result = dependency.to_pep_508() assert ( - result - == "Django (>=1.23,<2.0) ; " + result == "Django (>=1.23,<2.0) ; " "(" 'python_version >= "2.7" and python_version < "2.8" ' 'or python_version >= "3.6" and python_version < "4.0"' @@ -89,8 +87,7 @@ def test_to_pep_508_in_extras() -> None: result = dependency.to_pep_508(with_extras=False) assert ( - result - == "Django (>=1.23,<2.0) ; " + result == "Django (>=1.23,<2.0) ; " 'python_version >= "2.7" and python_version < "2.8" ' 'or python_version >= "3.6" and python_version < "4.0"' ) diff --git a/tests/packages/test_main.py b/tests/packages/test_main.py index 6e56f0001..862f12631 100644 --- a/tests/packages/test_main.py +++ b/tests/packages/test_main.py @@ -103,8 +103,7 @@ def test_dependency_from_pep_508_complex() -> None: assert dep.in_extras == ["foo"] assert dep.python_versions == ">=2.7 !=3.2.*" assert ( - str(dep.marker) - == 'python_version >= "2.7" and python_version != "3.2" ' + str(dep.marker) == 'python_version >= "2.7" and python_version != "3.2" ' 'and (sys_platform == "win32" or sys_platform == "darwin") ' 'and extra == "foo"' ) @@ -169,8 +168,7 @@ def test_dependency_from_pep_508_with_python_version_union_of_multi() -> None: assert dep.extras == frozenset() assert dep.python_versions == ">=2.7 <2.8 || >=3.4 <3.5" assert ( - str(dep.marker) - == 'python_version >= "2.7" and python_version < "2.8" ' + str(dep.marker) == 'python_version >= "2.7" and python_version < "2.8" ' 'or python_version >= "3.4" and python_version < "3.5"' ) @@ -288,8 +286,7 @@ def test_dependency_from_pep_508_with_python_full_version() -> None: assert dep.extras == frozenset() assert dep.python_versions == ">=2.7 <2.8 || >=3.4.0 <3.5.4" assert ( - str(dep.marker) - == 'python_version >= "2.7" and python_version < "2.8" ' + str(dep.marker) == 'python_version >= "2.7" and python_version < "2.8" ' 'or python_full_version >= "3.4.0" and python_full_version < "3.5.4"' ) diff --git a/tests/spdx/test_license.py b/tests/spdx/test_license.py index 6cada0735..d5b2f5c37 100644 --- a/tests/spdx/test_license.py +++ b/tests/spdx/test_license.py @@ -28,8 +28,7 @@ def test_classifier() -> None: license = license_by_id("lgpl-3.0-or-later") assert ( - license.classifier - == "License :: " + license.classifier == "License :: " "OSI Approved :: " "GNU Lesser General Public License v3 or later (LGPLv3+)" ) diff --git a/tests/version/test_markers.py b/tests/version/test_markers.py index 1d1315fe2..6389a99b1 100644 --- a/tests/version/test_markers.py +++ b/tests/version/test_markers.py @@ -292,8 +292,7 @@ def test_single_marker_union_with_multi() -> None: parse_marker('implementation_name == "cpython" and python_version >= "3.6"') ) assert ( - str(union) - == 'implementation_name == "cpython" and python_version >= "3.6" or' + str(union) == 'implementation_name == "cpython" and python_version >= "3.6" or' ' sys_platform == "darwin"' ) @@ -536,8 +535,7 @@ def test_multi_marker_union_multi() -> None: union = m.union(parse_marker('python_version >= "3.6" and os_name == "Windows"')) assert ( - str(union) - == 'sys_platform == "darwin" and implementation_name == "cpython" ' + str(union) == 'sys_platform == "darwin" and implementation_name == "cpython" ' 'or python_version >= "3.6" and os_name == "Windows"' ) @@ -809,8 +807,7 @@ def test_marker_union_union_with_union() -> None: parse_marker('implementation_name == "cpython" or os_name == "Windows"') ) assert ( - str(union) - == 'sys_platform == "darwin" or python_version < "3.4" ' + str(union) == 'sys_platform == "darwin" or python_version < "3.4" ' 'or implementation_name == "cpython" or os_name == "Windows"' ) @@ -1784,8 +1781,7 @@ def test_intersection_avoids_combinatorial_explosion() -> None: ' or platform_machine == "WIN32")' ) assert ( - str(m2.intersect(m1)) - == 'python_full_version >= "3.11.0"' + str(m2.intersect(m1)) == 'python_full_version >= "3.11.0"' ' and (platform_machine == "aarch64" or platform_machine == "ppc64le"' ' or platform_machine == "x86_64" or platform_machine == "amd64"' ' or platform_machine == "AMD64" or platform_machine == "win32"'