Skip to content

Commit 48b24a5

Browse files
authored
Merge pull request #11 from django-components/jo-refactor-package-name
refactor: change python module name to djc_pydantic and add py.typed
2 parents b1de5cd + d13d85c commit 48b24a5

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Then add the extension to your project:
100100
# settings.py
101101
COMPONENTS = {
102102
"extensions": [
103-
"djc_ext_pydantic.PydanticExtension",
103+
"djc_pydantic.PydanticExtension",
104104
],
105105
}
106106
```
@@ -109,7 +109,7 @@ or by reference:
109109

110110
```python
111111
# settings.py
112-
from djc_ext_pydantic import PydanticExtension
112+
from djc_pydantic import PydanticExtension
113113

114114
COMPONENTS = {
115115
"extensions": [

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Homepage = "https://github.com/django-components/djc-ext-pydantic/"
4444

4545
[tool.setuptools.packages.find]
4646
where = ["src"]
47-
include = ["djc_ext_pydantic*"]
48-
exclude = ["djc_ext_pydantic.tests*"]
47+
include = ["djc_pydantic*"]
48+
exclude = ["djc_pydantic.tests*"]
4949
namespaces = false
5050

5151
[tool.black]
@@ -71,7 +71,7 @@ profile = "black"
7171
line_length = 119
7272
multi_line_output = 3
7373
include_trailing_comma = "True"
74-
known_first_party = "djc_ext_pydantic"
74+
known_first_party = "djc_pydantic"
7575

7676
[tool.flake8]
7777
ignore = ['E302', 'W503']
@@ -93,7 +93,7 @@ exclude = [
9393
]
9494

9595
[[tool.mypy.overrides]]
96-
module = "djc_ext_pydantic.*"
96+
module = "djc_pydantic.*"
9797
disallow_untyped_defs = true
9898

9999

src/djc_ext_pydantic/__init__.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/djc_pydantic/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from djc_pydantic.monkeypatch import monkeypatch_pydantic_core_schema
2+
from djc_pydantic.extension import PydanticExtension
3+
4+
5+
monkeypatch_pydantic_core_schema()
6+
7+
__all__ = [
8+
"PydanticExtension",
9+
]

src/djc_ext_pydantic/extension.py renamed to src/djc_pydantic/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
OnComponentDataContext,
55
)
66

7-
from djc_ext_pydantic.validation import get_component_typing, validate_type
7+
from djc_pydantic.validation import get_component_typing, validate_type
88

99

1010
class PydanticExtension(ComponentExtension):
File renamed without changes.

src/djc_pydantic/py.typed

Whitespace-only changes.
File renamed without changes.

tests/test_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# from pydantic import ValidationError # TODO: Set more specific error message
77
from typing_extensions import TypedDict
88

9-
from djc_ext_pydantic.extension import PydanticExtension
9+
from djc_pydantic.extension import PydanticExtension
1010
from tests.testutils import setup_test_config
1111

1212
setup_test_config()

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ commands = flake8 .
4040

4141
[testenv:isort]
4242
deps = isort
43-
commands = isort --check-only --diff src/djc_ext_pydantic
43+
commands = isort --check-only --diff src/djc_pydantic
4444

4545
[testenv:coverage]
4646
deps =
@@ -49,7 +49,7 @@ deps =
4949
pytest-asyncio
5050
syrupy # snapshot testing
5151
commands =
52-
pytest --cov=djc_ext_pydantic --cov-fail-under=87 --cov-branch
52+
pytest --cov=djc_pydantic --cov-fail-under=87 --cov-branch
5353

5454
[testenv:mypy]
5555
deps =
@@ -58,4 +58,4 @@ commands = mypy .
5858

5959
[testenv:black]
6060
deps = black
61-
commands = black --check src/djc_ext_pydantic
61+
commands = black --check src/djc_pydantic

0 commit comments

Comments
 (0)