openepd 1.10.0__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {openepd-1.10.0 → openepd-3.0.0}/PKG-INFO +2 -2
  2. {openepd-1.10.0 → openepd-3.0.0}/pyproject.toml +2 -2
  3. openepd-3.0.0/src/openepd/__version__.py +20 -0
  4. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/dto/base.py +1 -1
  5. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/dto/common.py +3 -5
  6. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/dto/meta.py +1 -2
  7. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/dto/mf.py +1 -2
  8. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/epd/dto.py +1 -2
  9. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/pcr/dto.py +1 -2
  10. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/bundle/model.py +1 -2
  11. openepd-3.0.0/src/openepd/compat/pydantic.py +29 -0
  12. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/base.py +4 -6
  13. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/category.py +1 -2
  14. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/common.py +4 -6
  15. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/epd.py +1 -2
  16. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/lcia.py +1 -2
  17. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/org.py +1 -2
  18. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/pcr.py +1 -2
  19. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/__init__.py +1 -2
  20. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/aluminium.py +1 -2
  21. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/asphalt.py +1 -2
  22. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/base.py +1 -2
  23. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/concrete.py +1 -2
  24. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/glass.py +1 -2
  25. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/steel.py +1 -2
  26. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/wood.py +1 -2
  27. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/standard.py +1 -2
  28. openepd-3.0.0/src/openepd/model/validation/__init__.py +19 -0
  29. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/validation/common.py +1 -2
  30. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/validation/numbers.py +1 -1
  31. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/validation/quantity.py +1 -2
  32. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/versioning.py +2 -3
  33. openepd-1.10.0/src/openepd/__version__.py +0 -20
  34. {openepd-1.10.0 → openepd-3.0.0}/LICENSE +0 -0
  35. {openepd-1.10.0 → openepd-3.0.0}/README.md +0 -0
  36. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/__init__.py +0 -0
  37. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/__init__.py +0 -0
  38. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/base_sync_client.py +0 -0
  39. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/category/__init__.py +0 -0
  40. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/category/dto.py +0 -0
  41. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/category/sync_api.py +0 -0
  42. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/common.py +0 -0
  43. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/dto/__init__.py +0 -0
  44. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/dto/params.py +0 -0
  45. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/epd/__init__.py +0 -0
  46. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/epd/sync_api.py +0 -0
  47. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/errors.py +0 -0
  48. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/pcr/__init__.py +0 -0
  49. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/pcr/sync_api.py +0 -0
  50. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/sync_client.py +0 -0
  51. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/api/test/__init__.py +0 -0
  52. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/bundle/__init__.py +0 -0
  53. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/bundle/base.py +0 -0
  54. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/bundle/reader.py +0 -0
  55. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/bundle/writer.py +0 -0
  56. {openepd-1.10.0/src/openepd/model → openepd-3.0.0/src/openepd/compat}/__init__.py +0 -0
  57. {openepd-1.10.0/src/openepd/model/validation → openepd-3.0.0/src/openepd/model}/__init__.py +0 -0
  58. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/factory.py +0 -0
  59. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/model/specs/README.md +0 -0
  60. {openepd-1.10.0 → openepd-3.0.0}/src/openepd/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openepd
3
- Version: 1.10.0
3
+ Version: 3.0.0
4
4
  Summary: Python library to work with OpenEPD format
5
5
  Home-page: https://github.com/cchangelabs/openepd
6
6
  License: Apache-2.0
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
19
  Provides-Extra: api-client
20
20
  Requires-Dist: email-validator (>=1.3.1)
21
- Requires-Dist: pydantic (>=1.10,<2.0)
21
+ Requires-Dist: pydantic (>=1.10,<3.0)
22
22
  Requires-Dist: requests (>=2.0) ; extra == "api-client"
23
23
  Project-URL: Repository, https://github.com/cchangelabs/openepd
24
24
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openepd"
3
- version = "1.10.0"
3
+ version = "3.0.0"
4
4
  license = "Apache-2.0"
5
5
  description = "Python library to work with OpenEPD format"
6
6
  authors = ["C-Change Labs <support@c-change-labs.com>"]
@@ -21,7 +21,7 @@ exclude = ["**/test_*.py", "**/tests/**"]
21
21
 
22
22
  [tool.poetry.dependencies]
23
23
  python = "^3.11"
24
- pydantic = ">=1.10,<2.0"
24
+ pydantic = ">=1.10,<3.0"
25
25
  email-validator = ">=1.3.1"
26
26
  requests = { version = ">=2.0", optional = true }
27
27
 
@@ -0,0 +1,20 @@
1
+ #
2
+ # Copyright 2024 by C Change Labs Inc. www.c-change-labs.com
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # This software was developed with support from the Skanska USA,
17
+ # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
+ # Find out more at www.BuildingTransparency.org
19
+ #
20
+ VERSION = "3.0.0"
@@ -19,7 +19,7 @@
19
19
  #
20
20
  import abc
21
21
 
22
- import pydantic as pyd
22
+ from openepd.compat.pydantic import pyd
23
23
 
24
24
 
25
25
  class BaseOpenEpdApiModel(pyd.BaseModel):
@@ -21,11 +21,9 @@ import abc
21
21
  import datetime
22
22
  from typing import Final, Generic, TypeAlias, TypeVar
23
23
 
24
- import pydantic as pyd
25
- from pydantic.generics import GenericModel
26
-
27
24
  from openepd.api.dto.base import BaseMetaDto, BaseOpenEpdApiModel, MetaExtensionBase
28
25
  from openepd.api.dto.meta import PerformanceMetaMixin
26
+ from openepd.compat.pydantic import pyd, pyd_generics
29
27
  from openepd.model.base import AnySerializable, BaseOpenEpdSchema
30
28
 
31
29
  DEFAULT_PAGE_SIZE: Final[int] = 100
@@ -65,7 +63,7 @@ TMetaDto = TypeVar("TMetaDto", bound=BaseMetaDto)
65
63
  TMetaExtension = TypeVar("TMetaExtension", bound=MetaExtensionBase)
66
64
 
67
65
 
68
- class MetaCollectionDto(BaseOpenEpdApiModel, GenericModel, Generic[TMetaExtension]):
66
+ class MetaCollectionDto(BaseOpenEpdApiModel, pyd_generics.GenericModel, Generic[TMetaExtension]):
69
67
  """
70
68
  This class is intended to be used as a container for different meta objects.
71
69
 
@@ -107,7 +105,7 @@ class BaseMeta(PerformanceMetaMixin, MetaCollectionDto[TMetaExtension], Generic[
107
105
  TMeta = TypeVar("TMeta", bound=MetaCollectionDto, covariant=True)
108
106
 
109
107
 
110
- class OpenEpdApiResponse(GenericModel, BaseOpenEpdApiModel, Generic[TPayload, TMeta]):
108
+ class OpenEpdApiResponse(pyd_generics.GenericModel, BaseOpenEpdApiModel, Generic[TPayload, TMeta]):
111
109
  """Standard DTO representing response from OpenEPD API server."""
112
110
 
113
111
  payload: TPayload
@@ -17,9 +17,8 @@
17
17
  # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
18
  # Find out more at www.BuildingTransparency.org
19
19
  #
20
- import pydantic as pyd
21
-
22
20
  from openepd.api.dto.base import BaseMetaDto, BaseOpenEpdApiModel
21
+ from openepd.compat.pydantic import pyd
23
22
 
24
23
 
25
24
  class PerformanceMeta(BaseMetaDto):
@@ -17,9 +17,8 @@
17
17
  # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
18
  # Find out more at www.BuildingTransparency.org
19
19
  #
20
- import pydantic as pyd
21
-
22
20
  from openepd.api.dto.base import BaseOpenEpdApiModel
21
+ from openepd.compat.pydantic import pyd
23
22
 
24
23
 
25
24
  class MaterialFilterDefinition(BaseOpenEpdApiModel):
@@ -19,12 +19,11 @@
19
19
  #
20
20
  from typing import TypeAlias
21
21
 
22
- import pydantic as pyd
23
-
24
22
  from openepd.api.dto.base import BaseOpenEpdApiModel
25
23
  from openepd.api.dto.common import BaseMeta, OpenEpdApiResponse
26
24
  from openepd.api.dto.meta import PagingMetaMixin, WarningMetaMixin
27
25
  from openepd.api.dto.mf import MaterialFilterMetaMixin
26
+ from openepd.compat.pydantic import pyd
28
27
  from openepd.model.common import Amount
29
28
  from openepd.model.epd import Epd
30
29
 
@@ -17,9 +17,8 @@
17
17
  # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
18
  # Find out more at www.BuildingTransparency.org
19
19
  #
20
- import pydantic as pyd
21
-
22
20
  from openepd.api.dto.base import BaseOpenEpdApiModel
21
+ from openepd.compat.pydantic import pyd
23
22
 
24
23
 
25
24
  class PcrRef(BaseOpenEpdApiModel):
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.base import BaseOpenEpdSchema
25
24
 
26
25
 
@@ -0,0 +1,29 @@
1
+ #
2
+ # Copyright 2024 by C Change Labs Inc. www.c-change-labs.com
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # This software was developed with support from the Skanska USA,
17
+ # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
+ # Find out more at www.BuildingTransparency.org
19
+ #
20
+ try:
21
+ from pydantic import v1 as pyd # type: ignore
22
+ from pydantic.v1 import generics as pyd_generics # type: ignore
23
+ except ImportError:
24
+ import pydantic as pyd # type: ignore[no-redef]
25
+ from pydantic import generics as pyd_generics # type: ignore[no-redef]
26
+
27
+ pydantic = pyd
28
+
29
+ __all__ = ["pyd", "pydantic", "pyd_generics"]
@@ -20,15 +20,13 @@
20
20
  import abc
21
21
  from enum import StrEnum
22
22
  import json
23
- from typing import Any, Callable, Generic, Optional, Type, TypeVar
24
-
25
- import pydantic as pyd
26
- from pydantic.generics import GenericModel
23
+ from typing import Any, Callable, Generic, Optional, Type, TypeAlias, TypeVar
27
24
 
25
+ from openepd.compat.pydantic import pyd, pyd_generics
28
26
  from openepd.model.validation.common import validate_version_compatibility, validate_version_format
29
27
  from openepd.model.versioning import OpenEpdVersions, Version
30
28
 
31
- AnySerializable = int | str | bool | float | list | dict | pyd.BaseModel | None
29
+ AnySerializable: TypeAlias = int | str | bool | float | list | dict | pyd.BaseModel | None
32
30
  TAnySerializable = TypeVar("TAnySerializable", bound=AnySerializable)
33
31
 
34
32
  OPENEPD_VERSION_FIELD = "openepd_version"
@@ -158,7 +156,7 @@ class BaseOpenEpdSchema(pyd.BaseModel):
158
156
  return None
159
157
 
160
158
 
161
- class BaseOpenEpdGenericSchema(GenericModel, BaseOpenEpdSchema):
159
+ class BaseOpenEpdGenericSchema(pyd_generics.GenericModel, BaseOpenEpdSchema):
162
160
  """Base class for all OpenEPD generic models."""
163
161
 
164
162
  pass
@@ -17,8 +17,7 @@
17
17
  # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
18
  # Find out more at www.BuildingTransparency.org
19
19
  #
20
- import pydantic as pyd
21
-
20
+ from openepd.compat.pydantic import pyd
22
21
  from openepd.model.base import BaseOpenEpdSchema
23
22
  from openepd.model.common import Amount
24
23
 
@@ -20,9 +20,7 @@
20
20
  from enum import StrEnum
21
21
  from typing import Annotated, Any
22
22
 
23
- import pydantic as pyd
24
- from pydantic import BaseModel, root_validator
25
-
23
+ from openepd.compat.pydantic import pyd
26
24
  from openepd.model.base import BaseOpenEpdSchema
27
25
 
28
26
 
@@ -32,7 +30,7 @@ class Amount(BaseOpenEpdSchema):
32
30
  qty: float | None = pyd.Field(description="How much of this in the amount.", default=None)
33
31
  unit: str | None = pyd.Field(description="Which unit. SI units are preferred.", example="kg", default=None)
34
32
 
35
- @root_validator
33
+ @pyd.root_validator
36
34
  def check_qty_or_unit(cls, values: dict[str, Any]):
37
35
  """Ensure that qty or unit is provided."""
38
36
  if values["qty"] is None and values["unit"] is None:
@@ -93,7 +91,7 @@ class Location(BaseOpenEpdSchema):
93
91
  )
94
92
 
95
93
 
96
- class WithAttachmentsMixin(BaseModel):
94
+ class WithAttachmentsMixin(pyd.BaseModel):
97
95
  """Mixin for objects that can have attachments."""
98
96
 
99
97
  attachments: dict[Annotated[str, pyd.Field(max_length=200)], pyd.AnyUrl] | None = pyd.Field(
@@ -117,7 +115,7 @@ class WithAttachmentsMixin(BaseModel):
117
115
  self.set_attachment(name, url)
118
116
 
119
117
 
120
- class WithAltIdsMixin(BaseModel):
118
+ class WithAltIdsMixin(pyd.BaseModel):
121
119
  """Mixin for objects that can have alt_ids."""
122
120
 
123
121
  alt_ids: dict[Annotated[str, pyd.Field(max_length=200)], str] | None = pyd.Field(
@@ -20,8 +20,7 @@
20
20
  import datetime
21
21
  from typing import Annotated
22
22
 
23
- import pydantic as pyd
24
-
23
+ from openepd.compat.pydantic import pyd
25
24
  from openepd.model.base import BaseDocumentFactory, RootDocument
26
25
  from openepd.model.common import Amount, Ingredient, WithAltIdsMixin, WithAttachmentsMixin
27
26
  from openepd.model.lcia import Impacts, OutputFlowSet, ResourceUseSet
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.base import BaseOpenEpdSchema
25
24
  from openepd.model.common import Measurement
26
25
 
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from typing import Annotated, Optional
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.base import BaseOpenEpdSchema
25
24
  from openepd.model.common import Location, WithAltIdsMixin, WithAttachmentsMixin
26
25
  from openepd.model.validation.common import ReferenceStr
@@ -21,8 +21,7 @@ import datetime
21
21
  from enum import StrEnum
22
22
  from typing import Annotated, Optional
23
23
 
24
- import pydantic as pyd
25
-
24
+ from openepd.compat.pydantic import pyd
26
25
  from openepd.model.base import BaseOpenEpdSchema
27
26
  from openepd.model.common import WithAltIdsMixin, WithAttachmentsMixin
28
27
  from openepd.model.org import Org
@@ -18,8 +18,7 @@
18
18
  # Find out more at www.BuildingTransparency.org
19
19
  #
20
20
 
21
- import pydantic as pyd
22
-
21
+ from openepd.compat.pydantic import pyd
23
22
  from openepd.model.base import BaseOpenEpdSchema
24
23
  from openepd.model.specs import concrete, steel
25
24
  from openepd.model.specs.aluminium import AluminiumV1
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec
25
24
  from openepd.model.validation.numbers import RatioFloat
26
25
 
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.common import OpenEPDUnit
25
24
  from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec
26
25
  from openepd.model.validation.numbers import RatioFloat
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from typing import Any
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.base import BaseOpenEpdSchema, Version
25
24
  from openepd.model.validation.common import validate_version_compatibility, validate_version_format
26
25
  from openepd.model.validation.quantity import QuantityValidator
@@ -20,8 +20,7 @@
20
20
  from enum import StrEnum
21
21
  from typing import Literal
22
22
 
23
- import pydantic as pyd
24
-
23
+ from openepd.compat.pydantic import pyd
25
24
  from openepd.model.base import BaseOpenEpdSchema
26
25
  from openepd.model.common import OpenEPDUnit
27
26
  from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec, BaseOpenEpdSpec
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.base import BaseOpenEpdSchema
25
24
  from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec
26
25
  from openepd.model.validation.numbers import PositiveInt, RatioFloat
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.base import BaseOpenEpdSchema
25
24
  from openepd.model.common import OpenEPDUnit
26
25
  from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from enum import StrEnum
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.org import OrgRef
25
24
  from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec
26
25
  from openepd.model.validation.numbers import RatioFloat
@@ -17,8 +17,7 @@
17
17
  # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
18
  # Find out more at www.BuildingTransparency.org
19
19
  #
20
- import pydantic as pyd
21
-
20
+ from openepd.compat.pydantic import pyd
22
21
  from openepd.model.base import BaseOpenEpdSchema
23
22
  from openepd.model.org import Org
24
23
 
@@ -0,0 +1,19 @@
1
+ #
2
+ # Copyright 2024 by C Change Labs Inc. www.c-change-labs.com
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ # This software was developed with support from the Skanska USA,
17
+ # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
+ # Find out more at www.BuildingTransparency.org
19
+ #
@@ -19,8 +19,7 @@
19
19
  #
20
20
  from typing import Annotated, Any, Callable, Type, TypeAlias
21
21
 
22
- import pydantic as pyd
23
-
22
+ from openepd.compat.pydantic import pyd
24
23
  from openepd.model.versioning import Version
25
24
 
26
25
 
@@ -19,7 +19,7 @@
19
19
  #
20
20
  from typing import Annotated
21
21
 
22
- import pydantic as pyd
22
+ from openepd.compat.pydantic import pyd
23
23
 
24
24
  # todo when move to pydantic 2, check that validators are being enforced.
25
25
  RatioFloat = Annotated[float, pyd.Field(ge=0, le=1, example=0.5)]
@@ -20,8 +20,7 @@
20
20
  from abc import ABC, abstractmethod
21
21
  from typing import TYPE_CHECKING, Annotated, Callable, TypeAlias
22
22
 
23
- import pydantic as pyd
24
-
23
+ from openepd.compat.pydantic import pyd
25
24
  from openepd.model.common import OpenEPDUnit
26
25
 
27
26
  if TYPE_CHECKING:
@@ -21,11 +21,10 @@ from abc import ABC
21
21
  from enum import ReprEnum
22
22
  from typing import ClassVar, NamedTuple
23
23
 
24
- import pydantic as pyd
25
- from pydantic import BaseModel
24
+ from openepd.compat.pydantic import pyd
26
25
 
27
26
 
28
- class WithExtVersionMixin(ABC, BaseModel):
27
+ class WithExtVersionMixin(ABC, pyd.BaseModel):
29
28
  """Mixin for extensions supporting versions: recommended way."""
30
29
 
31
30
  _EXT_VERSION: ClassVar[str]
@@ -1,20 +0,0 @@
1
- #
2
- # Copyright 2024 by C Change Labs Inc. www.c-change-labs.com
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- #
16
- # This software was developed with support from the Skanska USA,
17
- # Charles Pankow Foundation, Microsoft Sustainability Fund, Interface, MKA Foundation, and others.
18
- # Find out more at www.BuildingTransparency.org
19
- #
20
- VERSION = "1.10.0"
File without changes
File without changes
File without changes