Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 30, 2024
1 parent 0c01c5c commit 0c891a0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions tests/masonry/builders/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
15 changes: 12 additions & 3 deletions tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
9 changes: 3 additions & 6 deletions tests/packages/test_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
)
Expand Down Expand Up @@ -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"'
Expand All @@ -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"'
)
Expand Down
9 changes: 3 additions & 6 deletions tests/packages/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
)
Expand Down Expand Up @@ -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"'
)

Expand Down Expand Up @@ -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"'
)

Expand Down
3 changes: 1 addition & 2 deletions tests/spdx/test_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -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+)"
)
Expand Down
12 changes: 4 additions & 8 deletions tests/version/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
)

Expand Down Expand Up @@ -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"'
)

Expand Down Expand Up @@ -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"'
)

Expand Down Expand Up @@ -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"'
Expand Down

0 comments on commit 0c891a0

Please sign in to comment.