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 #16

Merged
merged 2 commits into from
Jun 22, 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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ["--write-changes"]
Expand All @@ -15,12 +15,12 @@ repos:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.8.0"
rev: "2.1.3"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.1"
rev: "v0.4.9"
hooks:
- id: ruff-format
- id: ruff
Expand Down
64 changes: 40 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ keywords = [
"virtual",
]
license = "MIT"
maintainers = [{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }]
authors = [{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }]
maintainers = [
{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
]
authors = [
{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
]
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -43,7 +47,7 @@ dynamic = [
"version",
]
dependencies = [
'typing-extensions>=4.7.1; python_version < "3.11"',
"typing-extensions>=4.7.1; python_version<'3.11'",
]
optional-dependencies.docs = [
"furo>=2024.1.29",
Expand All @@ -66,38 +70,43 @@ build.hooks.vcs.version-file = "src/py_discovery/_version.py"
version.source = "vcs"

[tool.ruff]
line-length = 120
target-version = "py37"
lint.isort = { known-first-party = ["py_discovery"], required-imports = ["from __future__ import annotations"] }
lint.select = ["ALL"]
line-length = 120
format.preview = true
format.docstring-code-line-length = 100
format.docstring-code-format = true
lint.select = [
"ALL",
]
lint.ignore = [
"INP001", # no implicit namespaces here
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod"
"ANN401", # Dynamically typed expressions
"COM812", # Conflict with formatter
"CPY", # no copyright
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"S104", # Possible binding to all interfaces
"CPY", # no copyright
"COM812", # Conflict with formatter
"INP001", # no implicit namespaces here
"ISC001", # Conflict with formatter
"S104", # Possible binding to all interfaces
]
lint.preview = true
format.preview = true
format.docstring-code-format = true
format.docstring-code-line-length = 100
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # asserts allowed in tests
lint.per-file-ignores."tests/**/*.py" = [
"D", # don't care about documentation in tests
"FBT", # don't care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"D", # don't care about documentation in tests
"S603", # `subprocess` call: check for execution of untrusted input
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"PLC0415", # import at top
"PLC2701", # Private imports
"PLR0917", # too many positional arguments
"PLC0415", # import at top
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"S101", # asserts allowed in tests
"S603", # `subprocess` call: check for execution of untrusted input
]
lint.isort = { known-first-party = [
"py_discovery",
], required-imports = [
"from __future__ import annotations",
] }
lint.preview = true

[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
Expand All @@ -117,12 +126,19 @@ paths.source = [
"*/src",
"*\\src",
]
report.omit = []
report.omit = [
]
run.parallel = true
run.plugins = ["covdefaults"]
run.plugins = [
"covdefaults",
]

[tool.mypy]
python_version = "3.8"
show_error_codes = true
strict = true
overrides = [{ module = ["setuptools.*"], ignore_missing_imports = true }]
overrides = [
{ module = [
"setuptools.*",
], ignore_missing_imports = true },
]
2 changes: 1 addition & 1 deletion src/py_discovery/_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def from_exe(
if isinstance(proposed, PythonInfo) and resolve_to_host:
try:
proposed = proposed._resolve_to_system(proposed) # noqa: SLF001
except Exception as exception: # noqa: BLE001
except Exception as exception:
if raise_on_error:
raise
logging.info("ignore %s due cannot resolve system due to %r", proposed.original_executable, exception)
Expand Down
Loading