diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e756709..c2cb22b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,28 +1,28 @@ exclude: ^tests/fixtures/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-yaml - id: debug-statements - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 + rev: v3.14.0 hooks: - id: reorder-python-imports args: [--application-directories, '.:src', --py38-plus] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.10.0 hooks: - id: black - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.19.0 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.13.0 hooks: - id: mypy exclude: ^(docs/|tests/) @@ -31,7 +31,7 @@ repos: hooks: - id: gitlint - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.5.0 + rev: v2.7.0 hooks: - id: setup-cfg-fmt args: [--min-py3-version, '3.8'] diff --git a/uritemplate/api.py b/uritemplate/api.py index ac75473..8da3914 100644 --- a/uritemplate/api.py +++ b/uritemplate/api.py @@ -6,6 +6,7 @@ This module contains the very simple API provided by uritemplate. """ + import typing as t from uritemplate import variable diff --git a/uritemplate/template.py b/uritemplate/template.py index 73ef89c..3205380 100644 --- a/uritemplate/template.py +++ b/uritemplate/template.py @@ -14,6 +14,7 @@ > """ + import re import typing as t @@ -35,7 +36,6 @@ def _merge( class URITemplate: - """This parses the template and will be used to expand it. This is the most important object as the center of the API. diff --git a/uritemplate/variable.py b/uritemplate/variable.py index da406ca..0436f21 100644 --- a/uritemplate/variable.py +++ b/uritemplate/variable.py @@ -14,6 +14,7 @@ > """ + import collections.abc import typing as t import urllib.parse @@ -29,7 +30,6 @@ class URIVariable: - """This object validates everything inside the URITemplate object. It validates template expansions and will truncate length as decided by @@ -59,9 +59,9 @@ def __init__(self, var: str): #: List of safe characters when quoting the string self.safe: str = "" #: List of variables in this variable - self.variables: t.List[ - t.Tuple[str, t.MutableMapping[str, t.Any]] - ] = [] + self.variables: t.List[t.Tuple[str, t.MutableMapping[str, t.Any]]] = ( + [] + ) #: List of variable names self.variable_names: t.List[str] = [] #: List of defaults passed in