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

Uprev all dependencies #4955

Merged
merged 2 commits into from
Jan 15, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ jobs:
with:
extra_args: --all-files --verbose

- run: make lint-flake8

- name: make history
run: python3 ./changes/make_history.py

Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ lint:
isort $(sources) --check-only --df
black $(sources) --check --diff

.PHONY: lint-flake8
lint-flake8:
flake8 $(sources)

.PHONY: mypy
mypy:
mypy pydantic docs/build --disable-recursive-aliases
Expand Down Expand Up @@ -97,7 +93,7 @@ clean:

.PHONY: docs
docs:
flake8 --max-line-length=80 docs/examples/
ruff docs/examples/
python docs/build/main.py
mkdocs build

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/models_field_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Model(BaseModel):
print(m.model_dump())
try:
Model(a='x', b='x', c='x', d='x', e='x')
except ValidationError as e:
error_locations = [e['loc'] for e in e.errors()]
except ValidationError as err:
error_locations = [e['loc'] for e in err.errors()]

print(error_locations)
9 changes: 9 additions & 0 deletions docs/examples/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
line-length = 80
ignore = ["E402", "F722"]
extend-select = ["Q"]
flake8-quotes = {inline-quotes = "single", multiline-quotes = "double"}

[per-file-ignores]
# waiting for https://github.com/charliermarsh/ruff/issues/282
"models_structural_pattern_matching.py" = ["E999"]
"schema_unenforced_constraints.py" = ["F811"]
8 changes: 4 additions & 4 deletions docs/examples/schema_unenforced_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ class Model(BaseModel):

# but you can set the schema attribute directly:
# (Note: here exclusiveMaximum will not be enforce)
class Model(BaseModel):
class ModelA(BaseModel):
foo: PositiveInt = Field(..., exclusiveMaximum=10)


print(Model.model_json_schema())
print(ModelA.model_json_schema())


# if you find yourself needing this, an alternative is to declare
# the constraints in Field (or you could use conint())
# here both constraints will be enforced:
class Model(BaseModel):
class ModelB(BaseModel):
# Here both constraints will be applied and the schema
# will be generated correctly
foo: int = Field(..., gt=0, lt=10)


print(Model.model_json_schema())
print(ModelB.model_json_schema())
1 change: 0 additions & 1 deletion pydantic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa
from pydantic_core import ValidationError

from . import dataclasses
Expand Down
12 changes: 0 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ filterwarnings = [
reviewers = ['samuelcolvin', 'PrettyWood', 'hramezani', 'kennethreitz']
require_change_file = false

[tool.flake8]
max_line_length = 120
max_complexity = 14
inline_quotes = 'single'
multiline_quotes = 'double'
ignore = ['E203', 'W503']
per_file_ignores = [
'docs/examples/schema_unenforced_constraints.py:F811',
'docs/examples/validation_decorator_async.py:E402',
'docs/examples/types_constrained.py:F722',
]

[tool.ruff]
line-length = 120
extend-select = ['Q']
Expand Down
38 changes: 19 additions & 19 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
#
ansi2html==1.8.0
# via -r requirements/docs.in
autoflake==1.7.7
autoflake==2.0.0
# via -r requirements/docs.in
certifi==2022.12.7
# via requests
charset-normalizer==2.1.1
charset-normalizer==3.0.1
# via requests
click==8.1.3
# via mkdocs
colorama==0.4.6
# via mkdocs-material
ghp-import==2.1.0
# via mkdocs
greenlet==2.0.1
# via sqlalchemy
idna==3.4
# via requests
jinja2==3.1.2
Expand All @@ -31,7 +31,7 @@ markdown==3.3.7
# mkdocs
# mkdocs-material
# pymdown-extensions
markdown-include==0.7.0
markdown-include==0.8.0
# via -r requirements/docs.in
markupsafe==2.1.1
# via jinja2
Expand All @@ -46,22 +46,20 @@ mkdocs==1.4.2
# mkdocs-material
mkdocs-exclude==1.0.2
# via -r requirements/docs.in
mkdocs-material==8.5.9
mkdocs-material==9.0.5
# via -r requirements/docs.in
mkdocs-material-extensions==1.1
mkdocs-material-extensions==1.1.1
# via mkdocs-material
orjson==3.8.1
orjson==3.8.5
# via -r requirements/docs.in
packaging==21.3
packaging==23.0
# via mkdocs
pyflakes==2.5.0
pyflakes==3.0.1
# via autoflake
pygments==2.13.0
pygments==2.14.0
# via mkdocs-material
pymdown-extensions==9.8
pymdown-extensions==9.9.1
# via mkdocs-material
pyparsing==3.0.9
# via packaging
python-dateutil==2.8.2
# via ghp-import
pyyaml==6.0
Expand All @@ -70,17 +68,19 @@ pyyaml==6.0
# pyyaml-env-tag
pyyaml-env-tag==0.1
# via mkdocs
requests==2.28.1
regex==2022.10.31
# via mkdocs-material
requests==2.28.2
# via mkdocs-material
six==1.16.0
# via python-dateutil
sqlalchemy==1.4.43
sqlalchemy==1.4.46
# via -r requirements/docs.in
tomli==2.0.1
# via autoflake
ujson==5.5.0
ujson==5.7.0
# via -r requirements/docs.in
urllib3==1.26.12
urllib3==1.26.14
# via requests
watchdog==2.1.9
watchdog==2.2.1
# via mkdocs
6 changes: 1 addition & 5 deletions requirements/linting.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
annotated-types
black
flake8
flake8-quotes
flake8-pyproject
hypothesis
isort
# pydantic-core is required for mypy
pydantic-core
pyupgrade
# pinned, see #4735
mypy==0.982
mypy
pre-commit
ruff
44 changes: 13 additions & 31 deletions requirements/linting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,26 @@
#
annotated-types==0.4.0
# via -r requirements/linting.in
attrs==22.1.0
attrs==22.2.0
# via hypothesis
black==22.10.0
black==22.12.0
# via -r requirements/linting.in
cfgv==3.3.1
# via pre-commit
click==8.1.3
# via black
distlib==0.3.6
# via virtualenv
exceptiongroup==1.0.1
exceptiongroup==1.1.0
# via hypothesis
filelock==3.8.0
filelock==3.9.0
# via virtualenv
flake8==5.0.4
# via
# -r requirements/linting.in
# flake8-pyproject
# flake8-quotes
flake8-pyproject==1.1.0.post0
# via -r requirements/linting.in
flake8-quotes==3.3.1
hypothesis==6.62.1
# via -r requirements/linting.in
hypothesis==6.56.4
# via -r requirements/linting.in
identify==2.5.8
identify==2.5.13
# via pre-commit
isort==5.10.1
isort==5.11.4
# via -r requirements/linting.in
mccabe==0.7.0
# via flake8
mypy==0.991
# via -r requirements/linting.in
mypy-extensions==0.4.3
Expand All @@ -45,42 +34,35 @@ mypy-extensions==0.4.3
# mypy
nodeenv==1.7.0
# via pre-commit
pathspec==0.10.1
pathspec==0.10.3
# via black
platformdirs==2.5.3
platformdirs==2.6.2
# via
# black
# virtualenv
pre-commit==2.20.0
pre-commit==2.21.0
# via -r requirements/linting.in
pycodestyle==2.9.1
# via flake8
pydantic-core==0.7.1
# via -r requirements/linting.in
pyflakes==2.5.0
# via flake8
pyupgrade==3.2.2
pyupgrade==3.3.1
# via -r requirements/linting.in
pyyaml==6.0
# via pre-commit
ruff==0.0.109
ruff==0.0.222
# via -r requirements/linting.in
sortedcontainers==2.4.0
# via hypothesis
tokenize-rt==5.0.0
# via pyupgrade
toml==0.10.2
# via pre-commit
tomli==2.0.1
# via
# black
# flake8-pyproject
# mypy
typing-extensions==4.4.0
# via
# mypy
# pydantic-core
virtualenv==20.16.6
virtualenv==20.17.1
# via pre-commit

# The following packages are considered to be unsafe in a requirements file:
Expand Down
3 changes: 1 addition & 2 deletions requirements/testing-extra.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
devtools
hypothesis
# pinned, see #4735
mypy==0.982
mypy
12 changes: 6 additions & 6 deletions requirements/testing-extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
#
# pip-compile --output-file=requirements/testing-extra.txt --resolver=backtracking requirements/testing-extra.in
#
asttokens==2.1.0
asttokens==2.2.1
# via devtools
attrs==22.1.0
attrs==22.2.0
# via hypothesis
devtools==0.9.0
devtools==0.10.0
# via -r requirements/testing-extra.in
exceptiongroup==1.0.1
exceptiongroup==1.1.0
# via hypothesis
executing==0.10.0
executing==1.2.0
# via devtools
hypothesis==6.56.4
hypothesis==6.62.1
# via -r requirements/testing-extra.in
mypy==0.991
# via -r requirements/testing-extra.in
Expand Down
20 changes: 9 additions & 11 deletions requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,25 @@
#
# pip-compile --output-file=requirements/testing.txt --resolver=backtracking requirements/testing.in
#
attrs==22.1.0
attrs==22.2.0
# via pytest
commonmark==0.9.1
# via rich
coverage[toml]==6.5.0
coverage[toml]==7.0.5
# via -r requirements/testing.in
dirty-equals==0.5.0
# via -r requirements/testing.in
exceptiongroup==1.0.1
exceptiongroup==1.1.0
# via pytest
iniconfig==1.1.1
iniconfig==2.0.0
# via pytest
packaging==21.3
packaging==23.0
# via pytest
pluggy==1.0.0
# via pytest
pygments==2.13.0
pygments==2.14.0
# via rich
pyparsing==3.0.9
# via packaging
pytest==7.2.0
pytest==7.2.1
# via
# -r requirements/testing.in
# pytest-mock
Expand All @@ -33,9 +31,9 @@ pytest-mock==3.10.0
# via -r requirements/testing.in
pytest-pretty==0.0.1
# via -r requirements/testing.in
pytz==2022.6
pytz==2022.7.1
# via dirty-equals
rich==12.6.0
rich==13.1.0
# via pytest-pretty
tomli==2.0.1
# via
Expand Down