Skip to content

Commit

Permalink
deps: allow pydantic v2 (#109)
Browse files Browse the repository at this point in the history
* deps: allow pydantic v2

* fix: formatting & ignore typing on duplicate import
  • Loading branch information
marier-nico authored Jul 19, 2023
1 parent 818456b commit 83b60a8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: requirements.txt
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
black
invoke
mypy
pydantic ~= 1.10.4
pydantic==2.0.3
pylama
pytest
pytest-cov
requests
semver
sphinx ~= 6.1.3
sphinx
sphinx-rtd-theme
tox
twine
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
package_dir={"": "src"},
packages=find_packages(where="src"),
install_requires=[],
extras_require={"pydantic": ["pydantic >= 1.8.2,< 2.0"]},
extras_require={"pydantic": ["pydantic >= 1.8.2,< 3.0"]},
package_data={"": ["VERSION"], "event_processor": ["py.typed"]},

# Other configurations
Expand Down
2 changes: 1 addition & 1 deletion src/event_processor/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
try:
from typing import get_args, get_origin # type: ignore
except ImportError: # pragma: no cover
from src.event_processor.util import py37_get_origin as get_origin
from src.event_processor.util import py37_get_origin as get_origin # type: ignore
from src.event_processor.util import py37_get_args as get_args


Expand Down
2 changes: 0 additions & 2 deletions src/tests/test_event_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def b_test():


def test_processor_raises_exception_when_the_processor_takes_invalid_params(event_processor):

with pytest.raises(FilterError):

@event_processor.processor(Accept())
Expand Down Expand Up @@ -152,7 +151,6 @@ def b_test():


def test_invoke_raises_for_no_matching_processors(event_processor):

with pytest.raises(InvocationError):
event_processor.invoke({"a": 0})

Expand Down

0 comments on commit 83b60a8

Please sign in to comment.