Skip to content

Drop python<3.9 backports #1367

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

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: 1 addition & 5 deletions jsonschema/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@

from importlib import metadata
from json import JSONDecodeError
from pkgutil import resolve_name
from textwrap import dedent
import argparse
import json
import sys
import traceback
import warnings

try:
from pkgutil import resolve_name
except ImportError:
from pkgutil_resolve_name import resolve_name # type: ignore[no-redef]

from attrs import define, field

from jsonschema.exceptions import SchemaError
Expand Down
81 changes: 39 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ requires-python = ">=3.9"
license = "MIT"
license-files = ["COPYING"]
keywords = [
"validation",
"data validation",
"jsonschema",
"json",
"json schema",
"validation",
"data validation",
"jsonschema",
"json",
"json schema",
]
authors = [
{ name = "Julian Berman", email = "[email protected]" },
Expand All @@ -42,9 +42,6 @@ dependencies = [
"jsonschema-specifications>=2023.03.6",
"referencing>=0.28.4",
"rpds-py>=0.7.1",

"importlib_resources>=1.4.0;python_version<'3.9'",
"pkgutil_resolve_name>=1.3.10;python_version<'3.9'",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -129,8 +126,8 @@ skip_covered = true

[tool.doc8]
ignore = [
"D000", # see PyCQA/doc8#125
"D001", # one sentence per line, so max length doesn't make sense
"D000", # see PyCQA/doc8#125
"D001", # one sentence per line, so max length doesn't make sense
]

[tool.mypy]
Expand All @@ -145,53 +142,53 @@ extend-exclude = ["json"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"A001", # It's fine to shadow builtins
"A001", # It's fine to shadow builtins
"A002",
"A003",
"A005",
"ARG", # This is all wrong whenever an interface is involved
"ANN", # Just let the type checker do this
"B006", # Mutable arguments require care but are OK if you don't abuse them
"B008", # It's totally OK to call functions for default arguments.
"B904", # raise SomeException(...) is fine.
"B905", # No need for explicit strict, this is simply zip's default behavior
"C408", # Calling dict is fine when it saves quoting the keys
"C901", # Not really something to focus on
"D105", # It's fine to not have docstrings for magic methods.
"D107", # __init__ especially doesn't need a docstring
"D200", # This rule makes diffs uglier when expanding docstrings
"D203", # No blank lines before docstrings.
"D212", # Start docstrings on the second line.
"D400", # This rule misses sassy docstrings ending with ! or ?
"D401", # This rule is too flaky.
"D406", # Section headers should end with a colon not a newline
"D407", # Underlines aren't needed
"D412", # Plz spaces after section headers
"EM101", # These don't bother me.
"ARG", # This is all wrong whenever an interface is involved
"ANN", # Just let the type checker do this
"B006", # Mutable arguments require care but are OK if you don't abuse them
"B008", # It's totally OK to call functions for default arguments.
"B904", # raise SomeException(...) is fine.
"B905", # No need for explicit strict, this is simply zip's default behavior
"C408", # Calling dict is fine when it saves quoting the keys
"C901", # Not really something to focus on
"D105", # It's fine to not have docstrings for magic methods.
"D107", # __init__ especially doesn't need a docstring
"D200", # This rule makes diffs uglier when expanding docstrings
"D203", # No blank lines before docstrings.
"D212", # Start docstrings on the second line.
"D400", # This rule misses sassy docstrings ending with ! or ?
"D401", # This rule is too flaky.
"D406", # Section headers should end with a colon not a newline
"D407", # Underlines aren't needed
"D412", # Plz spaces after section headers
"EM101", # These don't bother me.
"EM102",
"FBT", # It's worth avoiding boolean args but I don't care to enforce it
"FIX", # Yes thanks, if I could it wouldn't be there
"N", # These naming rules are silly
"PERF203", # try/excepts in loops are sometimes needed
"PLR0911", # These metrics are fine to be aware of but not to enforce
"FBT", # It's worth avoiding boolean args but I don't care to enforce it
"FIX", # Yes thanks, if I could it wouldn't be there
"N", # These naming rules are silly
"PERF203", # try/excepts in loops are sometimes needed
"PLR0911", # These metrics are fine to be aware of but not to enforce
"PLR0912",
"PLR0913",
"PLR0915",
"PLR1714", # This makes for uglier comparisons sometimes
"PLW0642", # Shadowing self also isn't a big deal.
"PLW2901", # Shadowing for loop variables is occasionally fine.
"PT", # We use unittest
"PLR1714", # This makes for uglier comparisons sometimes
"PLW0642", # Shadowing self also isn't a big deal.
"PLW2901", # Shadowing for loop variables is occasionally fine.
"PT", # We use unittest
"PYI025", # wat, I'm not confused, thanks.
"RET502", # Returning None implicitly is fine
"RET503",
"RET505", # These push you to use `if` instead of `elif`, but for no reason
"RET506",
"RSE102", # Ha, what, who even knew you could leave the parens off. But no.
"SIM300", # Not sure what heuristic this uses, but it's easily incorrect
"SIM300", # Not sure what heuristic this uses, but it's easily incorrect
"SLF001", # Private usage within this package itself is fine
"TD", # These TODO style rules are also silly
"TD", # These TODO style rules are also silly
"TRY003", # Some exception classes are essentially intended for free-form
"UP007", # We support 3.9
"UP007", # We support 3.9
]

[tool.ruff.lint.flake8-pytest-style]
Expand Down