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

Modifying package for Pydantic Settings #803

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion docs/providers/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ the container will call ``config.from_pydantic()`` automatically:

or install ``pydantic`` directly::

pip install pydantic
pip install pydantic-settings

*Don't forget to mirror the changes in the requirements file.*

Expand Down
2 changes: 1 addition & 1 deletion examples/providers/configuration/configuration_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

from dependency_injector import containers, providers
from pydantic import BaseSettings, Field
from pydantic_settings import BaseSettings, Field

# Emulate environment variables
os.environ["AWS_ACCESS_KEY_ID"] = "KEY"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

from dependency_injector import containers, providers
from pydantic import BaseSettings, Field
from pydantic_settings import BaseSettings, Field

# Emulate environment variables
os.environ["AWS_ACCESS_KEY_ID"] = "KEY"
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mypy
pyyaml
httpx
fastapi
pydantic
pydantic-settings
numpy
scipy
boto3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _open(filename):
"pyyaml",
],
"pydantic": [
"pydantic",
"pydantic-settings",
],
"flask": [
"flask",
Expand Down
2 changes: 1 addition & 1 deletion src/dependency_injector/providers.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ except ImportError:
yaml = None

try:
import pydantic
import pydantic_settings as pydantic
except ImportError:
pydantic = None

Expand Down
2 changes: 1 addition & 1 deletion src/dependency_injector/providers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ except ImportError:
yaml = None

try:
import pydantic
import pydantic_settings as pydantic
except ImportError:
pydantic = None

Expand Down
2 changes: 1 addition & 1 deletion tests/typing/configuration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

from dependency_injector import providers
from pydantic import BaseSettings as PydanticSettings
from pydantic_settings import BaseSettings as PydanticSettings


# Test 1: to check the getattr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Configuration.from_pydantic() tests."""

import pydantic
import pydantic_settings as pydantic
from dependency_injector import providers, errors
from pytest import fixture, mark, raises

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Configuration.from_pydantic() tests."""

import pydantic
import pydantic_settings as pydantic
from dependency_injector import providers
from pytest import fixture, mark, raises

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ deps=
mypy_boto3_s3
extras=
yaml
pydantic
pydantic-settings
flask
aiohttp
commands = pytest -c tests/.configs/pytest.ini
Expand Down