Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #141

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.5.0
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand All @@ -27,7 +27,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.5
rev: 0.28.6
hooks:
- id: check-github-workflows
- id: check-renovate
Expand All @@ -38,10 +38,9 @@ repos:
- id: actionlint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.18
Expand Down
44 changes: 24 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ keywords = [
"keyboard",
"search",
]
license = {text = "ISC"}
maintainers = [{name = "Hugo van Kemenade"}]
authors = [{name = "Kenneth Reitz", email = "me@kennethreitz.org"}]
license = { text = "ISC" }
maintainers = [
{ name = "Hugo van Kemenade" },
]
authors = [
{ name = "Kenneth Reitz", email = "me@kennethreitz.org" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -39,20 +43,16 @@ dynamic = [
"version",
]
dependencies = [
'pyperclip; platform_system == "Darwin"',
'pyperclip; platform_system == "Windows"',
"pyperclip; platform_system=='Windows'",
]
[project.optional-dependencies]
tests = [
optional-dependencies.tests = [
"pytest",
"pytest-cov",
]
[project.urls]
Changelog = "https://github.com/hugovk/em-keyboard/releases"
Homepage = "https://github.com/hugovk/em-keyboard"
Source = "https://github.com/hugovk/em-keyboard"
[project.scripts]
em = "em_keyboard:cli"
urls.Changelog = "https://github.com/hugovk/em-keyboard/releases"
urls.Homepage = "https://github.com/hugovk/em-keyboard"
urls.Source = "https://github.com/hugovk/em-keyboard"
scripts.em = "em_keyboard:cli"

[tool.hatch]
version.source = "vcs"
Expand All @@ -63,8 +63,7 @@ local_scheme = "no-local-version"
[tool.ruff]
fix = true

[tool.ruff.lint]
select = [
lint.select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"EM", # flake8-errmsg
Expand All @@ -74,19 +73,24 @@ select = [
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"PYI", # flake8-pyi
"RUF100", # unused noqa (yesqa)
"RUF022", # unsorted-dunder-all
"RUF100", # unused noqa (yesqa)
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
ignore = [
lint.ignore = [
"E203", # Whitespace before ':'
"E221", # Multiple spaces before operator
"E226", # Missing whitespace around arithmetic operator
"E241", # Multiple spaces after ','
]
lint.isort.known-first-party = [
"em_keyboard",
]
lint.isort.required-imports = [
"from __future__ import annotations",
]

[tool.ruff.lint.isort]
known-first-party = ["em_keyboard"]
required-imports = ["from __future__ import annotations"]
[tool.pyproject-fmt]
max_supported_python = "3.13"
18 changes: 9 additions & 9 deletions tests/test_em.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_star(mock_print: MagicMock, mock_argparse: MagicMock, test_name: str) -
mock_print.assert_called_once_with("Copied! ⭐")
else:
mock_print.assert_called_once_with("⭐")
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 0


Expand All @@ -52,7 +52,7 @@ def test_not_found(mock_print: MagicMock, mock_argparse: MagicMock) -> None:

# Assert
mock_print.assert_called_once_with("")
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 1


Expand All @@ -70,7 +70,7 @@ def test_no_copy(mock_print: MagicMock, mock_argparse: MagicMock) -> None:

# Assert
mock_print.assert_called_once_with("⭐")
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 0


Expand All @@ -94,7 +94,7 @@ def test_search_star(mock_print: MagicMock, mock_argparse: MagicMock) -> None:
# Assert
for arg in expected:
assert call(arg) in mock_print.call_args_list
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 0


Expand All @@ -117,7 +117,7 @@ def test_search_single_result_is_copied(
mock_print.assert_called_once_with("Copied! 🇺🇦 flag_ukraine")
else:
mock_print.assert_called_once_with("🇺🇦 flag_ukraine")
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 0


Expand All @@ -135,7 +135,7 @@ def test_search_not_found(mock_print: MagicMock, mock_argparse: MagicMock) -> No

# Assert
mock_print.assert_not_called()
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 1


Expand All @@ -157,7 +157,7 @@ def test_random(mock_print: MagicMock, mock_argparse: MagicMock) -> None:
mock_print.assert_called_once_with("Copied! 😽 kissing_cat")
else:
mock_print.assert_called_once_with("😽 kissing_cat")
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 0


Expand All @@ -176,7 +176,7 @@ def test_random_no_copy(mock_print: MagicMock, mock_argparse: MagicMock) -> None

# Assert
mock_print.assert_called_once_with("😽 kissing_cat")
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == 0


Expand All @@ -194,5 +194,5 @@ def test_no_name(mock_print: MagicMock, mock_argparse: MagicMock) -> None:

# Assert
mock_print.assert_not_called()
assert e.type == SystemExit
assert e.type is SystemExit
assert e.value.code == "Error: the 'name' argument is required"
Loading