Skip to content

refactor: change python module name to djc_pydantic and add py.typed #11

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

Merged
merged 2 commits into from
Apr 5, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Then add the extension to your project:
# settings.py
COMPONENTS = {
"extensions": [
"djc_ext_pydantic.PydanticExtension",
"djc_pydantic.PydanticExtension",
],
}
```
Expand All @@ -109,7 +109,7 @@ or by reference:

```python
# settings.py
from djc_ext_pydantic import PydanticExtension
from djc_pydantic import PydanticExtension

COMPONENTS = {
"extensions": [
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Homepage = "https://github.com/django-components/djc-ext-pydantic/"

[tool.setuptools.packages.find]
where = ["src"]
include = ["djc_ext_pydantic*"]
exclude = ["djc_ext_pydantic.tests*"]
include = ["djc_pydantic*"]
exclude = ["djc_pydantic.tests*"]
namespaces = false

[tool.black]
Expand All @@ -71,7 +71,7 @@ profile = "black"
line_length = 119
multi_line_output = 3
include_trailing_comma = "True"
known_first_party = "djc_ext_pydantic"
known_first_party = "djc_pydantic"

[tool.flake8]
ignore = ['E302', 'W503']
Expand All @@ -93,7 +93,7 @@ exclude = [
]

[[tool.mypy.overrides]]
module = "djc_ext_pydantic.*"
module = "djc_pydantic.*"
disallow_untyped_defs = true


Expand Down
9 changes: 0 additions & 9 deletions src/djc_ext_pydantic/__init__.py

This file was deleted.

9 changes: 9 additions & 0 deletions src/djc_pydantic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from djc_pydantic.monkeypatch import monkeypatch_pydantic_core_schema
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was still just renamed + updated imports, but git sees it as a new file

from djc_pydantic.extension import PydanticExtension


monkeypatch_pydantic_core_schema()

__all__ = [
"PydanticExtension",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
OnComponentDataContext,
)

from djc_ext_pydantic.validation import get_component_typing, validate_type
from djc_pydantic.validation import get_component_typing, validate_type


class PydanticExtension(ComponentExtension):
Expand Down
File renamed without changes.
Empty file added src/djc_pydantic/py.typed
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# from pydantic import ValidationError # TODO: Set more specific error message
from typing_extensions import TypedDict

from djc_ext_pydantic.extension import PydanticExtension
from djc_pydantic.extension import PydanticExtension
from tests.testutils import setup_test_config

setup_test_config()
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ commands = flake8 .

[testenv:isort]
deps = isort
commands = isort --check-only --diff src/djc_ext_pydantic
commands = isort --check-only --diff src/djc_pydantic

[testenv:coverage]
deps =
Expand All @@ -49,7 +49,7 @@ deps =
pytest-asyncio
syrupy # snapshot testing
commands =
pytest --cov=djc_ext_pydantic --cov-fail-under=87 --cov-branch
pytest --cov=djc_pydantic --cov-fail-under=87 --cov-branch

[testenv:mypy]
deps =
Expand All @@ -58,4 +58,4 @@ commands = mypy .

[testenv:black]
deps = black
commands = black --check src/djc_ext_pydantic
commands = black --check src/djc_pydantic
Loading