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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.8.0
hooks:
- id: black
args: ["--target-version", "py37"]

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

Expand All @@ -16,7 +16,7 @@ repos:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-yaml
Expand Down
1 change: 0 additions & 1 deletion jsonmodels/builders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Builders to generate in memory representation of model and fields tree."""


from collections import defaultdict

from . import errors
Expand Down
1 change: 0 additions & 1 deletion jsonmodels/collections.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
class ModelCollection(list):

"""`ModelCollection` is list which validates stored values.

Validation is made with use of field passed to `__init__` at each point,
Expand Down
11 changes: 0 additions & 11 deletions jsonmodels/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


class BaseField:

"""Base class for all fields."""

types = None
Expand Down Expand Up @@ -142,14 +141,12 @@ def structue_name(self, default):


class StringField(BaseField):

"""String field."""

types = (str,)


class IntField(BaseField):

"""Integer field."""

types = (int,)
Expand All @@ -163,14 +160,12 @@ def parse_value(self, value):


class FloatField(BaseField):

"""Float field."""

types = (float, int)


class BoolField(BaseField):

"""Bool field."""

types = (bool,)
Expand All @@ -182,14 +177,12 @@ def parse_value(self, value):


class DictField(BaseField):

"""Dict field."""

types = (dict,)


class ListField(BaseField):

"""List field."""

types = (list,)
Expand Down Expand Up @@ -300,7 +293,6 @@ def to_struct(self, values):


class EmbeddedField(BaseField):

"""Field for embedded models."""

def __init__(self, model_types, *args, **kwargs):
Expand Down Expand Up @@ -403,7 +395,6 @@ def _import(module_name, type_name):


class TimeField(StringField):

"""Time field."""

types = (datetime.time,)
Expand Down Expand Up @@ -434,7 +425,6 @@ def parse_value(self, value):


class DateField(StringField):

"""Date field."""

types = (datetime.date,)
Expand Down Expand Up @@ -466,7 +456,6 @@ def parse_value(self, value):


class DateTimeField(StringField):

"""Datetime field."""

types = (datetime.datetime,)
Expand Down
1 change: 0 additions & 1 deletion jsonmodels/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def validate_fields(attributes):


class Base(metaclass=JsonmodelMeta):

"""Base class for all models."""

def __init__(self, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions jsonmodels/parsers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Parsers to change model structure into different ones."""

import inspect

from . import builders, errors, fields
Expand Down
6 changes: 1 addition & 5 deletions jsonmodels/validators.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Predefined validators."""

import re
from functools import reduce

Expand All @@ -7,7 +8,6 @@


class Min:

"""Validator for minimum value."""

def __init__(self, minimum_value, exclusive=False):
Expand Down Expand Up @@ -41,7 +41,6 @@ def modify_schema(self, field_schema):


class Max:

"""Validator for maximum value."""

def __init__(self, maximum_value, exclusive=False):
Expand Down Expand Up @@ -75,7 +74,6 @@ def modify_schema(self, field_schema):


class Regex:

"""Validator for regular expressions."""

FLAGS = {
Expand Down Expand Up @@ -134,7 +132,6 @@ def modify_schema(self, field_schema):


class Length:

"""Validator for length."""

def __init__(self, minimum_value=None, maximum_value=None):
Expand Down Expand Up @@ -186,7 +183,6 @@ def modify_schema(self, field_schema):


class Enum:

"""Validator for enums."""

def __init__(self, *choices):
Expand Down
Loading