Skip to content

Commit 669f7d3

Browse files
authored
βž– Remove bo4e from dependencies πŸŽ‰ (#180)
1 parent a046976 commit 669f7d3

10 files changed

Lines changed: 89 additions & 67 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
pytest
22
pytest-asyncio
3+
bo4e==0.6.1
4+
# we're using this pinned version of bo4e because there's no version which contains this fix:
5+
# https://github.com/bo4e/BO4E-python/commit/3fd45539edd7d5bfdca990775244bf31007a5ca7
Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.12
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# pip-compile requirements-tests.in
66
#
7+
annotated-types==0.6.0
8+
# via pydantic
9+
bo4e==0.6.1
10+
# via -r requirements-tests.in
11+
colorama==0.4.6
12+
# via pytest
713
iniconfig==2.0.0
814
# via pytest
15+
iso3166==2.1.1
16+
# via bo4e
917
packaging==23.2
1018
# via pytest
1119
pluggy==1.3.0
1220
# via pytest
21+
pydantic==2.6.2
22+
# via bo4e
23+
pydantic-core==2.16.3
24+
# via pydantic
25+
pyhumps==3.8.0
26+
# via bo4e
1327
pytest==8.0.1
1428
# via
15-
# -r dev_requirements/requirements-tests.in
29+
# -r requirements-tests.in
1630
# pytest-asyncio
1731
pytest-asyncio==0.23.5
18-
# via -r dev_requirements/requirements-tests.in
32+
# via -r requirements-tests.in
33+
typing-extensions==4.9.0
34+
# via
35+
# pydantic
36+
# pydantic-core

β€Žrequirements.inβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
bo4e>=0.5.0
21
pydantic>=2.0.0
32
typeguard
43
frozendict

β€Žrequirements.txtβ€Ž

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.12
2+
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
55
# pip-compile requirements.in
66
#
7-
annotated-types==0.5.0
7+
annotated-types==0.6.0
88
# via pydantic
99
bidict==0.23.1
1010
# via
1111
# -r requirements.in
1212
# pvframework
13-
bo4e==0.6.1
14-
# via -r requirements.in
1513
frozendict==2.4.0
1614
# via
1715
# -r requirements.in
1816
# pvframework
1917
injector==0.21.0
2018
# via -r requirements.in
21-
iso3166==2.1.1
22-
# via bo4e
2319
networkx==3.2.1
2420
# via
2521
# -r requirements.in
@@ -29,11 +25,8 @@ pvframework==0.0.8
2925
pydantic==2.6.2
3026
# via
3127
# -r requirements.in
32-
# bo4e
3328
pydantic-core==2.16.3
3429
# via pydantic
35-
pyhumps==3.8.0
36-
# via bo4e
3730
python-generics==0.0.4
3831
# via -r requirements.in
3932
typeguard==4.1.5
@@ -44,3 +37,4 @@ typing-extensions==4.9.0
4437
# via
4538
# pydantic
4639
# pydantic-core
40+
# typeguard

β€Žsetup.cfgβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ zip_safe = False
3232
include_package_data = True
3333
python_requires = >=3.10
3434
install_requires =
35-
bo4e
3635
pydantic>=2.0.0
3736
typeguard>=4.0.1
3837
frozendict

β€Žsrc/bomf/loader/entityloader.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import Awaitable, Callable, Generic, Optional, TypeVar
1111

1212
from generics import get_filled_type
13-
from pydantic import BaseModel, TypeAdapter, ConfigDict, ValidationError # pylint:disable=no-name-in-module
13+
from pydantic import BaseModel, ConfigDict, TypeAdapter, ValidationError # pylint:disable=no-name-in-module
1414

1515
_TargetEntity = TypeVar("_TargetEntity")
1616

β€Žsrc/bomf/model/__init__.pyβ€Ž

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,11 @@
22
general data models for migrations
33
"""
44

5-
import enum
65
import uuid
76
from abc import ABC
8-
from typing import TypeVar, Union
97

10-
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt
11-
from bo4e.com.com import COM
128
from pydantic import BaseModel, Field # pylint: disable=no-name-in-module
139

14-
_SpecificBusinessObject = TypeVar("_SpecificBusinessObject", bound=Geschaeftsobjekt)
15-
"""
16-
an arbitrary but fixed business object type
17-
"""
18-
19-
_SpecificCom = TypeVar("_SpecificCom", bound=COM)
20-
"""
21-
an arbitrary but fixed COM type
22-
"""
23-
24-
Bo4eTyp = Union[_SpecificBusinessObject, _SpecificCom] # pylint: disable=invalid-name
25-
26-
27-
# pylint:disable=too-few-public-methods
28-
class BusinessObjectRelation(BaseModel):
29-
"""
30-
A business object relation describes the relation between two business object.
31-
E.g. a relation could have the type "has_melo" where relation_part_a is a bo4e.bo.Vertrag
32-
and relation_part_b is a bo4e.bo.Messlokation. Some relations are already defined in BO4E itself (e.g MaLo/MeLo)
33-
or MeLo/Address.
34-
The idea is to not enforce too much of a structure to the downstream code but still push coders to think about
35-
necessary relation information.
36-
"""
37-
38-
relation_type: enum.Enum
39-
"""
40-
The relation type describes how two business objects relate to each other.
41-
This is not (only) about cardinality. It's about being able to model different relations between objects.
42-
Think about e.g. a business partner and an address: The relation could be:
43-
- the address is the residential address of the business partner
44-
- the address is the invoice address of the business partner
45-
- the address is the place where the business partner was born
46-
All these relation types are 1:1 relations between business partners and adresses, yet they all carry different
47-
meaning which we'd like to distinguish in our data.
48-
"""
49-
relation_part_a: Bo4eTyp
50-
"""
51-
one Business Object or COM
52-
"""
53-
54-
relation_part_b: Bo4eTyp
55-
"""
56-
another Business Object or COM
57-
"""
58-
5910

6011
class Bo4eDataSet(BaseModel, ABC):
6112
"""

β€Žunittests/models.pyβ€Ž

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""
2+
models used for testing
3+
"""
4+
5+
import enum
6+
from typing import TypeVar, Union
7+
8+
from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt
9+
from bo4e.com.com import COM
10+
from pydantic import BaseModel
11+
12+
_SpecificBusinessObject = TypeVar("_SpecificBusinessObject", bound=Geschaeftsobjekt)
13+
"""
14+
an arbitrary but fixed business object type
15+
"""
16+
17+
_SpecificCom = TypeVar("_SpecificCom", bound=COM)
18+
"""
19+
an arbitrary but fixed COM type
20+
"""
21+
22+
Bo4eTyp = Union[_SpecificBusinessObject, _SpecificCom] # pylint: disable=invalid-name
23+
24+
25+
# pylint:disable=too-few-public-methods
26+
class BusinessObjectRelation(BaseModel):
27+
"""
28+
A business object relation describes the relation between two business object.
29+
E.g. a relation could have the type "has_melo" where relation_part_a is a bo4e.bo.Vertrag
30+
and relation_part_b is a bo4e.bo.Messlokation. Some relations are already defined in BO4E itself (e.g MaLo/MeLo)
31+
or MeLo/Address.
32+
The idea is to not enforce too much of a structure to the downstream code but still push coders to think about
33+
necessary relation information.
34+
"""
35+
36+
relation_type: enum.Enum
37+
"""
38+
The relation type describes how two business objects relate to each other.
39+
This is not (only) about cardinality. It's about being able to model different relations between objects.
40+
Think about e.g. a business partner and an address: The relation could be:
41+
- the address is the residential address of the business partner
42+
- the address is the invoice address of the business partner
43+
- the address is the place where the business partner was born
44+
All these relation types are 1:1 relations between business partners and adresses, yet they all carry different
45+
meaning which we'd like to distinguish in our data.
46+
"""
47+
relation_part_a: Bo4eTyp
48+
"""
49+
one Business Object or COM
50+
"""
51+
52+
relation_part_b: Bo4eTyp
53+
"""
54+
another Business Object or COM
55+
"""

β€Žunittests/test_bo4e_data_set.pyβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
from bo4e.bo.geschaeftspartner import Geschaeftspartner
66
from bo4e.com.adresse import Adresse
77

8-
from bomf.model import Bo4eDataSet, Bo4eTyp, BusinessObjectRelation
8+
from bomf.model import Bo4eDataSet
9+
10+
from .models import Bo4eTyp, BusinessObjectRelation
911

1012

1113
class _GeschaeftspartnerAdresseRelation(enum.Enum):

β€Žunittests/test_mapper.pyβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from typing import Optional, Type
22

3-
from pydantic import BaseModel
43
import pytest # type:ignore[import]
54
from bo4e.bo.marktlokation import Marktlokation
65
from bo4e.bo.messlokation import Messlokation
6+
from pydantic import BaseModel
77

88
from bomf.mapper import Bo4eDataSetToTargetMapper, PaginationNotSupportedException, SourceToBo4eDataSetMapper
9-
from bomf.model import Bo4eTyp
9+
10+
from .models import Bo4eTyp
1011

1112

1213
class _NotImplementedBo4eDataSetMixin:

0 commit comments

Comments
Β (0)