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

python311Packages.pydantic: 1.10.12 -> 2.3.0 #269633

Merged
merged 30 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4d3ce6f
python311Packages.pydantic: 1.10.12 -> 2.3.0
natsukium Oct 31, 2023
62a25b0
python311Packages.pydantic-settings: 2.0.3 -> 2.1.0
natsukium Nov 24, 2023
e9abc0e
python311Packages.pydantic_1: init at 1.10.3
natsukium Nov 28, 2023
3b44eb0
python311Packages.versioningit: 2.2.0 -> 2.2.1
natsukium Nov 1, 2023
1dc0695
python311Packages.fastapi: add optional-dependencies for pydantic 2
natsukium Nov 24, 2023
cb2e554
python311Packages.kanidm: 0.0.3 -> 0.0.3-unstable-2023-08-23
natsukium Nov 24, 2023
3fcadd4
python311Packages.django-ninja: 0.22.2 -> 1.0.1
natsukium Nov 24, 2023
4a22107
python311Packages.pythonfinder: 2.0.5 -> 2.0.6
natsukium Nov 24, 2023
59a1734
python311Packages.pyaussiebb: 0.0.18 -> 0.1.1
natsukium Nov 24, 2023
32de0e5
python311Packages.demetriek: apply a pydantic>=2 compatible patch
natsukium Nov 24, 2023
ee58382
python311Packages.demetriek: fix darwin sandbox build
natsukium Nov 24, 2023
415b748
python311Packages.fastapi-mail: 1.3.1 -> 1.4.1
natsukium Nov 24, 2023
6969dcd
python311Pacakges.napari-npe2: 0.7.2 -> 0.7.2-unstable-2023-10-20
natsukium Nov 25, 2023
0ee01ad
python311Packages.rstcheck-core: 1.0.3 -> 1.2.0
natsukium Nov 25, 2023
ce12f6b
python311Packages.strawberry-graphql: fix test with pydantic>=2
natsukium Nov 25, 2023
4ae5ff6
python311Packages.strawberry-graphql: fix darwin sandbox build
natsukium Nov 25, 2023
395e37f
python311Packages.xbox-webapi: 2.0.11 -> 2.1.0
dotlambda Nov 27, 2023
cf3b676
cloudflare-dyndns: pin pydantic_1
natsukium Nov 28, 2023
44dfa42
flare-floss: pin pydantic_1
natsukium Nov 28, 2023
152eb42
khoj: 0.3.0 -> 1.0.1
natsukium Nov 28, 2023
e940288
octoprint: pin pydantic_1
natsukium Nov 28, 2023
f2417e3
remote-exec: pin pydantic_1
natsukium Nov 25, 2023
01fc305
stacs: pin pydantic_1
natsukium Nov 24, 2023
d305cd4
python311Packages.aiopurpleair: apply patch for pydantic>=2
natsukium Nov 29, 2023
cc85f24
python311Packages.aionotion: apply patch for pydantic>=2
natsukium Nov 29, 2023
1f5eb93
python311Packages.aionotion: add meta.changelog
natsukium Nov 24, 2023
1a4f525
frigate: pin pydantic_1
natsukium Nov 29, 2023
a2ae17c
home-assistant: pin pydantic_1
natsukium Nov 29, 2023
8b4922f
home-assistant: pin versioningit at 2.2.0
mweinelt Dec 1, 2023
5395d9c
treewide: marke as broken due to incompatibility with pydantic>=2
natsukium Dec 2, 2023
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 pkgs/applications/misc/octoprint/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ let
zeroconf
zipstream-ng
class-doc
pydantic
pydantic_1
] ++ lib.optionals stdenv.isDarwin [
py.pkgs.appdirs
] ++ lib.optionals (!stdenv.isDarwin) [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/networking/cloudflare-dyndns/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ python3.pkgs.buildPythonApplication rec {
attrs
click
cloudflare
pydantic
pydantic_1
requests
];

Expand Down
6 changes: 6 additions & 0 deletions pkgs/applications/video/frigate/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ let

python = python3.override {
packageOverrides = self: super: {
pydantic = super.pydantic_1;

versioningit = super.versioningit.overridePythonAttrs {
# checkPhase requires pydantic>=2
doCheck = false;
};
};
};

Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/python-modules/aionotion/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ buildPythonPackage rec {
url = "https://github.com/bachya/aionotion/commit/53c7285110d12810f9b43284295f71d052a81b83.patch";
hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
})

# based on https://github.com/bachya/aionotion/pull/235
./pydantic_2-compatibility.patch
];

nativeBuildInputs = [
Expand Down Expand Up @@ -71,6 +74,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Python library for Notion Home Monitoring";
homepage = "https://github.com/bachya/aionotion";
changelog = "https://github.com/bachya/aionotion/releases/tag/${src.rev}";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
diff --git a/aionotion/bridge/models.py b/aionotion/bridge/models.py
index 260566d..f2e640c 100644
--- a/aionotion/bridge/models.py
+++ b/aionotion/bridge/models.py
@@ -5,7 +5,10 @@ from __future__ import annotations
from datetime import datetime
from typing import Optional, Union

-from pydantic import BaseModel, validator
+try:
+ from pydantic.v1 import BaseModel, validator
+except ModuleNotFoundError:
+ from pydantic import BaseModel, validator

from aionotion.helpers.validators import validate_timestamp

diff --git a/aionotion/client.py b/aionotion/client.py
index 5332334..e2f9035 100644
--- a/aionotion/client.py
+++ b/aionotion/client.py
@@ -5,7 +5,10 @@ from typing import Any, cast

from aiohttp import ClientSession, ClientTimeout
from aiohttp.client_exceptions import ClientError
-from pydantic import BaseModel, ValidationError
+try:
+ from pydantic.v1 import BaseModel, ValidationError
+except ModuleNotFoundError:
+ from pydantic import BaseModel, ValidationError

from aionotion.bridge import Bridge
from aionotion.const import LOGGER
diff --git a/aionotion/device/models.py b/aionotion/device/models.py
index c19bc3e..ea7f577 100644
--- a/aionotion/device/models.py
+++ b/aionotion/device/models.py
@@ -4,7 +4,10 @@ from __future__ import annotations

from datetime import datetime

-from pydantic import BaseModel, validator
+try:
+ from pydantic.v1 import BaseModel, validator
+except ModuleNotFoundError:
+ from pydantic import BaseModel, validator

from aionotion.helpers.validators import validate_timestamp

diff --git a/aionotion/helpers/typing.py b/aionotion/helpers/typing.py
index 130c5ab..b2c3726 100644
--- a/aionotion/helpers/typing.py
+++ b/aionotion/helpers/typing.py
@@ -1,6 +1,9 @@
"""Define typing helpers."""
from typing import TypeVar

-from pydantic import BaseModel
+try:
+ from pydantic.v1 import BaseModel
+except ModuleNotFoundError:
+ from pydantic import BaseModel

BaseModelT = TypeVar("BaseModelT", bound=BaseModel)
diff --git a/aionotion/sensor/models.py b/aionotion/sensor/models.py
index 3bcfb12..643a282 100644
--- a/aionotion/sensor/models.py
+++ b/aionotion/sensor/models.py
@@ -6,7 +6,10 @@ from datetime import datetime
from enum import Enum
from typing import Any, Literal, Optional

-from pydantic import BaseModel, Extra, validator
+try:
+ from pydantic.v1 import BaseModel, Extra, validator
+except ModuleNotFoundError:
+ from pydantic import BaseModel, Extra, validator

from aionotion.const import LOGGER
from aionotion.helpers.validators import validate_timestamp
diff --git a/aionotion/system/models.py b/aionotion/system/models.py
index d5b27d3..7931959 100644
--- a/aionotion/system/models.py
+++ b/aionotion/system/models.py
@@ -5,7 +5,10 @@ from __future__ import annotations
from datetime import datetime
from typing import Optional

-from pydantic import BaseModel, validator
+try:
+ from pydantic.v1 import BaseModel, validator
+except ModuleNotFoundError:
+ from pydantic import BaseModel, validator

from aionotion.helpers.validators import validate_timestamp

diff --git a/aionotion/user/models.py b/aionotion/user/models.py
index 856fbc3..723041e 100644
--- a/aionotion/user/models.py
+++ b/aionotion/user/models.py
@@ -2,7 +2,10 @@
# pylint: disable=too-few-public-methods
from __future__ import annotations

-from pydantic import BaseModel
+try:
+ from pydantic.v1 import BaseModel
+except ModuleNotFoundError:
+ from pydantic import BaseModel


class UserPreferences(BaseModel):
3 changes: 3 additions & 0 deletions pkgs/development/python-modules/aiopurpleair/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ buildPythonPackage rec {
url = "https://github.com/bachya/aiopurpleair/commit/8c704c51ea50da266f52a7f53198d29d643b30c5.patch";
hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
})

# based on https://github.com/bachya/aiopurpleair/pull/176
./pydantic_2-compatibility.patch
];

postPatch = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
diff --git a/aiopurpleair/api.py b/aiopurpleair/api.py
index d3b276b..c557015 100644
--- a/aiopurpleair/api.py
+++ b/aiopurpleair/api.py
@@ -5,7 +5,10 @@ from typing import Any, cast

from aiohttp import ClientSession, ClientTimeout
from aiohttp.client_exceptions import ClientError
-from pydantic import BaseModel, ValidationError
+try:
+ from pydantic.v1 import BaseModel, ValidationError
+except ModuleNotFoundError:
+ from pydantic import BaseModel, ValidationError

from aiopurpleair.const import LOGGER
from aiopurpleair.endpoints.sensors import SensorsEndpoints
diff --git a/aiopurpleair/endpoints/__init__.py b/aiopurpleair/endpoints/__init__.py
index 4d263e1..6632310 100644
--- a/aiopurpleair/endpoints/__init__.py
+++ b/aiopurpleair/endpoints/__init__.py
@@ -4,7 +4,10 @@ from __future__ import annotations
from collections.abc import Awaitable, Callable, Iterable
from typing import Any

-from pydantic import BaseModel, ValidationError
+try:
+ from pydantic.v1 import BaseModel, ValidationError
+except ModuleNotFoundError:
+ from pydantic import BaseModel, ValidationError

from aiopurpleair.errors import InvalidRequestError
from aiopurpleair.helpers.typing import ModelT
diff --git a/aiopurpleair/helpers/typing.py b/aiopurpleair/helpers/typing.py
index 4ae01e6..49f59e6 100644
--- a/aiopurpleair/helpers/typing.py
+++ b/aiopurpleair/helpers/typing.py
@@ -1,6 +1,9 @@
"""Define typing helpers."""
from typing import TypeVar

-from pydantic import BaseModel
+try:
+ from pydantic.v1 import BaseModel
+except ModuleNotFoundError:
+ from pydantic import BaseModel

ModelT = TypeVar("ModelT", bound=BaseModel)
diff --git a/aiopurpleair/models/keys.py b/aiopurpleair/models/keys.py
index 591ae01..ffadbcc 100644
--- a/aiopurpleair/models/keys.py
+++ b/aiopurpleair/models/keys.py
@@ -3,7 +3,10 @@ from __future__ import annotations

from datetime import datetime

-from pydantic import BaseModel, validator
+try:
+ from pydantic.v1 import BaseModel, validator
+except ModuleNotFoundError:
+ from pydantic import BaseModel, validator

from aiopurpleair.backports.enum import StrEnum
from aiopurpleair.helpers.validators import validate_timestamp
diff --git a/aiopurpleair/models/sensors.py b/aiopurpleair/models/sensors.py
index 5b99b51..d435996 100644
--- a/aiopurpleair/models/sensors.py
+++ b/aiopurpleair/models/sensors.py
@@ -5,7 +5,10 @@ from __future__ import annotations
from datetime import datetime
from typing import Any, Optional

-from pydantic import BaseModel, root_validator, validator
+try:
+ from pydantic.v1 import BaseModel, root_validator, validator
+except ModuleNotFoundError:
+ from pydantic import BaseModel, root_validator, validator

from aiopurpleair.const import SENSOR_FIELDS, ChannelFlag, ChannelState, LocationType
from aiopurpleair.helpers.validators import validate_timestamp
diff --git a/tests/models/test_keys.py b/tests/models/test_keys.py
index 0d7d7c8..b2e30c1 100644
--- a/tests/models/test_keys.py
+++ b/tests/models/test_keys.py
@@ -5,7 +5,10 @@ from datetime import datetime
from typing import Any

import pytest
-from pydantic import ValidationError
+try:
+ from pydantic.v1 import ValidationError
+except ModuleNotFoundError:
+ from pydantic import ValidationError

from aiopurpleair.models.keys import ApiKeyType, GetKeysResponse

diff --git a/tests/models/test_sensors.py b/tests/models/test_sensors.py
index a984b36..7b2c84f 100644
--- a/tests/models/test_sensors.py
+++ b/tests/models/test_sensors.py
@@ -5,7 +5,10 @@ from datetime import datetime
from typing import Any

import pytest
-from pydantic import ValidationError
+try:
+ from pydantic.v1 import ValidationError
+except ModuleNotFoundError:
+ from pydantic import ValidationError

from aiopurpleair.models.sensors import (
GetSensorsRequest,
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/bentoml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,7 @@ buildPythonPackage {
changelog = "https://github.com/bentoml/BentoML/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ happysalada natsukium ];
# https://github.com/bentoml/BentoML/issues/3885
broken = versionAtLeast pydantic.version "2";
};
}
1 change: 1 addition & 0 deletions pkgs/development/python-modules/correctionlib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ buildPythonPackage rec {
homepage = "https://cms-nanoaod.github.io/correctionlib/";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ veprbl ];
broken = versionAtLeast pydantic.version "2";
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,7 @@ buildPythonPackage rec {
homepage = "https://github.com/dbt-labs/dbt-semantic-interfaces";
license = licenses.asl20;
maintainers = with maintainers; [ pbsds ];
# https://github.com/dbt-labs/dbt-semantic-interfaces/issues/134
broken = versionAtLeast pydantic.version "2";
};
}
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/demetriek/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
, buildPythonPackage
, pydantic
, fetchFromGitHub
, fetchpatch
, poetry-core
, yarl
, aresponses
Expand All @@ -27,6 +28,16 @@ buildPythonPackage rec {
hash = "sha256-LCHHBcZgO9gw5jyaJiiS4lKyb0ut+PJvKTylIvIKHhc=";
};

patches = [
# https://github.com/frenck/python-demetriek/pull/531
(fetchpatch {
name = "pydantic_2-compatibility.patch";
url = "https://github.com/frenck/python-demetriek/commit/e677fe5b735b6b28572e3e5fd6aab56fc056f5e6.patch";
excludes = [ "pyproject.toml" "poetry.lock" ];
hash = "sha256-oMVR45KHDhcPId/0X9obJXCPE8s1gk5IgsGsgZesdZw=";
})
];

postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
Expand Down Expand Up @@ -56,6 +67,8 @@ buildPythonPackage rec {
"demetriek"
];

__darwinAllowLocalNetworking = true;

meta = with lib; {
description = "Python client for LaMetric TIME devices";
homepage = "https://github.com/frenck/python-demetriek";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,7 @@ buildPythonPackage rec {
changelog = "https://github.com/ets-labs/python-dependency-injector/blob/${version}/docs/main/changelog.rst";
license = licenses.bsd3;
maintainers = with maintainers; [ gerschtli ];
# https://github.com/ets-labs/python-dependency-injector/issues/726
broken = versionAtLeast pydantic.version "2";
};
}
9 changes: 5 additions & 4 deletions pkgs/development/python-modules/django-ninja/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@

buildPythonPackage rec {
pname = "django-ninja";
version = "0.22.2";
format = "pyproject";
version = "1.0.1";
pyproject = true;

disabled = pythonOlder "3.7";

src = fetchFromGitHub {
owner = "vitalik";
repo = "django-ninja";
rev = "v${version}";
hash = "sha256-oeisurp9seSn3X/5jFF9DMm9nU6uDYIU1b6/J3o2be0=";
hash = "sha256-hF6Z8i8M4mQtVPIupTSEIkJh0i/oMFFuE9PpODxq4fw=";
};

propagatedBuildInputs = [ django pydantic ];
Expand All @@ -38,7 +39,7 @@ buildPythonPackage rec {
meta = with lib; {
changelog = "https://github.com/vitalik/django-ninja/releases/tag/v${version}";
description = "Web framework for building APIs with Django and Python type hints";
homepage = "https://django-ninja.rest-framework.com/";
homepage = "https://django-ninja.dev";
license = licenses.mit;
maintainers = with maintainers; [ elohmeier ];
};
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/farm-haystack/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,7 @@ buildPythonPackage rec {
homepage = "https://github.com/deepset-ai/haystack";
license = licenses.asl20;
maintainers = with maintainers; [ happysalada ];
# https://github.com/deepset-ai/haystack/issues/5304
broken = versionAtLeast pydantic.version "2";
};
}
Loading