diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 58856e6..391a590 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,18 +4,18 @@ repos: - repo: https://github.com/fsfe/reuse-tool - rev: v4.0.3 + rev: v6.2.0 hooks: - id: reuse - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.7.1 + rev: v0.16.4 hooks: # Run the linter. - id: ruff @@ -24,6 +24,6 @@ repos: # Run the formatter. - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v2.3.1 hooks: - id: mypy diff --git a/pyproject.toml b/pyproject.toml index fdbe19a..3ab729e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,10 @@ optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} [tool.ruff.lint] select = ["ALL"] +ignore = [ + "PYI063", # CircuitPython does not support PEP484 + "CPY001", # don't want to add copyright headers +] -[tool.ruff.extend-per-file-ignores] +[tool.ruff.lint.extend-per-file-ignores] "tests.py" = ["PT"] diff --git a/toml/__init__.py b/toml/__init__.py index e1d69e2..ae4acbd 100644 --- a/toml/__init__.py +++ b/toml/__init__.py @@ -12,8 +12,8 @@ __all__ = [ "TOMLError", - "loads", - "load", - "dumps", "dump", + "dumps", + "load", + "loads", ] diff --git a/toml/_dotty.py b/toml/_dotty.py index 4e391dc..8ece6ac 100644 --- a/toml/_dotty.py +++ b/toml/_dotty.py @@ -161,3 +161,6 @@ def __delitem__(self, __key: object) -> None: # if table is empty after that, remove it too if len(table) == 0 and parent_table: parent_table.pop(keys[-1]) + + def __hash__(self) -> int: + return hash(self.data) diff --git a/toml/_toml.py b/toml/_toml.py index 9b400fa..b2c4e7e 100644 --- a/toml/_toml.py +++ b/toml/_toml.py @@ -330,7 +330,7 @@ def try_int(cls, string: str) -> int | None: "b": 2, "o": 8, "x": 16, - }.get(string[1], None) + }.get(string[1]) if base is None: msg = "Invalid number."