bomf
Advanced tools
| name: Dependabot auto-approve / -merge | ||
| on: pull_request | ||
| jobs: | ||
| dependabot: | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| PR_URL: ${{github.event.pull_request.html_url}} | ||
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
| if: ${{ github.actor == 'dependabot[bot]' }} | ||
| steps: | ||
| - name: Approve a PR | ||
| run: gh pr review --approve "$PR_URL" | ||
| - name: Enable auto-merge for Dependabot PRs | ||
| run: gh pr merge --auto --squash "$PR_URL" |
| { | ||
| "python.testing.unittestEnabled": false, | ||
| "python.testing.pytestEnabled": true, | ||
| "python.testing.cwd": "${workspaceFolder}/src", | ||
| "python.testing.pytestArgs": [ | ||
| "${workspaceFolder}/unittests" | ||
| ], | ||
| } |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
| # | ||
| # pip-compile requirements-coverage.in | ||
| # | ||
| coverage==7.4.1 | ||
| # via -r dev_requirements/requirements-coverage.in |
| black | ||
| isort |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
| # | ||
| # pip-compile '.\dev_requirements\requirements-formatting.in' | ||
| # | ||
| black==24.1.1 | ||
| # via -r .\dev_requirements\requirements-formatting.in | ||
| click==8.1.7 | ||
| # via black | ||
| colorama==0.4.6 | ||
| # via click | ||
| isort==5.13.2 | ||
| # via -r .\dev_requirements\requirements-formatting.in | ||
| mypy-extensions==1.0.0 | ||
| # via black | ||
| packaging==23.2 | ||
| # via black | ||
| pathspec==0.12.1 | ||
| # via black | ||
| platformdirs==4.2.0 | ||
| # via black |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
| # | ||
| # pip-compile requirements-linting.in | ||
| # | ||
| astroid==3.0.2 | ||
| # via pylint | ||
| colorama==0.4.6 | ||
| # via pylint | ||
| dill==0.3.7 | ||
| # via pylint | ||
| isort==5.13.2 | ||
| # via pylint | ||
| mccabe==0.7.0 | ||
| # via pylint | ||
| platformdirs==4.1.0 | ||
| # via pylint | ||
| pylint==3.0.3 | ||
| # via -r requirements-linting.in | ||
| tomlkit==0.12.3 | ||
| # via pylint |
| build | ||
| twine |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
| # | ||
| # pip-compile requirements-test_packaging.in | ||
| # | ||
| build==1.0.3 | ||
| # via -r requirements-test_packaging.in | ||
| certifi==2023.11.17 | ||
| # via requests | ||
| charset-normalizer==3.3.2 | ||
| # via requests | ||
| colorama==0.4.6 | ||
| # via build | ||
| docutils==0.20.1 | ||
| # via readme-renderer | ||
| idna==3.6 | ||
| # via requests | ||
| importlib-metadata==7.0.1 | ||
| # via twine | ||
| jaraco-classes==3.3.0 | ||
| # via keyring | ||
| keyring==24.3.0 | ||
| # via twine | ||
| markdown-it-py==3.0.0 | ||
| # via rich | ||
| mdurl==0.1.2 | ||
| # via markdown-it-py | ||
| more-itertools==10.1.0 | ||
| # via jaraco-classes | ||
| nh3==0.2.15 | ||
| # via readme-renderer | ||
| packaging==23.2 | ||
| # via build | ||
| pkginfo==1.9.6 | ||
| # via twine | ||
| pygments==2.17.2 | ||
| # via | ||
| # readme-renderer | ||
| # rich | ||
| pyproject-hooks==1.0.0 | ||
| # via build | ||
| pywin32-ctypes==0.2.2 | ||
| # via keyring | ||
| readme-renderer==42.0 | ||
| # via twine | ||
| requests==2.31.0 | ||
| # via | ||
| # requests-toolbelt | ||
| # twine | ||
| requests-toolbelt==1.0.0 | ||
| # via twine | ||
| rfc3986==2.0.0 | ||
| # via twine | ||
| rich==13.7.0 | ||
| # via twine | ||
| twine==4.0.2 | ||
| # via -r requirements-test_packaging.in | ||
| urllib3==2.1.0 | ||
| # via | ||
| # requests | ||
| # twine | ||
| zipp==3.17.0 | ||
| # via importlib-metadata |
| pytest | ||
| pytest-asyncio |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
| # | ||
| # pip-compile requirements-tests.in | ||
| # | ||
| iniconfig==2.0.0 | ||
| # via pytest | ||
| packaging==23.2 | ||
| # via pytest | ||
| pluggy==1.3.0 | ||
| # via pytest | ||
| pytest==7.4.4 | ||
| # via | ||
| # -r dev_requirements/requirements-tests.in | ||
| # pytest-asyncio | ||
| pytest-asyncio==0.23.4 | ||
| # via -r dev_requirements/requirements-tests.in |
| mypy | ||
| types-frozendict | ||
| networkx-stubs |
| # | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
| # | ||
| # pip-compile requirements-type_check.in | ||
| # | ||
| mypy==1.8.0 | ||
| # via -r requirements-type_check.in | ||
| mypy-extensions==1.0.0 | ||
| # via mypy | ||
| networkx==3.2.1 | ||
| # via networkx-stubs | ||
| networkx-stubs==0.0.1 | ||
| # via -r requirements-type_check.in | ||
| types-frozendict==2.0.9 | ||
| # via -r requirements-type_check.in | ||
| typing-extensions==4.9.0 | ||
| # via mypy |
| name: "Black" | ||
| on: [push] | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| jobs: | ||
@@ -14,3 +19,3 @@ black: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -21,5 +26,5 @@ python-version: ${{ matrix.python-version }} | ||
| python -m pip install --upgrade pip | ||
| pip install black | ||
| pip install -r ./dev_requirements/requirements-formatting.txt | ||
| - name: Black Code Formatter | ||
| run: | | ||
| black . --check |
@@ -45,3 +45,3 @@ # For most projects, this workflow file will not need changing; you simply need | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v2 | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
@@ -57,3 +57,3 @@ languages: ${{ matrix.language }} | ||
| - name: Autobuild | ||
| uses: github/codeql-action/autobuild@v2 | ||
| uses: github/codeql-action/autobuild@v3 | ||
@@ -72,2 +72,2 @@ # ℹ️ Command-line programs to run using the OS shell. | ||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v2 | ||
| uses: github/codeql-action/analyze@v3 |
| name: "Coverage" | ||
| on: [push] | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| jobs: | ||
@@ -14,3 +19,3 @@ coverage: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -17,0 +22,0 @@ python-version: ${{ matrix.python-version }} |
| name: "Packaging Test" | ||
| on: [pull_request] | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| jobs: | ||
@@ -14,3 +19,3 @@ coverage: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -17,0 +22,0 @@ python-version: ${{ matrix.python-version }} |
| # This GitHub workflow is only needed for python package releases which are supposed to be published on pypi. | ||
| # It requires the Github "environments" feature (see instructions below) it might not be available for private free accounts (but works for public or organization repos). | ||
| # After creating the "release" environment in the Github repo settings, you need to enter your Github organization/user name + repo name + "python-publish.yml" workflow file name in the PyPI UI to make this work. | ||
| # This workflows will upload a Python Package using Twine when a release is created | ||
| # This workflow uploads a Python Package using Twine when a release is created. | ||
| # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
@@ -9,49 +11,53 @@ | ||
| on: | ||
| release: | ||
| types: [created, edited] | ||
| release: | ||
| types: [created, edited] | ||
| jobs: | ||
| tests: | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.12"] | ||
| os: [ubuntu-latest] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install tox | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install tox | ||
| - name: Run tox | ||
| run: | | ||
| tox | ||
| tests: | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.12"] | ||
| os: [ubuntu-latest] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install tox | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install tox | ||
| - name: Run tests | ||
| run: | | ||
| tox -e tests | ||
| build-n-publish: | ||
| name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
| runs-on: ubuntu-latest | ||
| needs: tests | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools setuptools-scm wheel twine | ||
| - name: Build a binary wheel and a source tarball | ||
| run: | | ||
| python setup.py sdist bdist_wheel | ||
| - name: Publish distribution 📦 to PyPI | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
| build-n-publish: | ||
| name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
| runs-on: ubuntu-latest | ||
| # Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/ | ||
| # you have to create an environment in your repository settings and add the environment name here | ||
| environment: release | ||
| permissions: | ||
| # IMPORTANT: this permission is mandatory for trusted publishing | ||
| id-token: write | ||
| needs: tests | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r dev_requirements/requirements-test_packaging.txt | ||
| - name: Build wheel and source distributions | ||
| run: | | ||
| python -m build | ||
| - name: Publish distribution 📦 to PyPI | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| name: "Linting" | ||
| on: [push] | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| jobs: | ||
@@ -16,3 +21,3 @@ pylint: | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -19,0 +24,0 @@ python-version: ${{ matrix.python-version }} |
| name: "Unittests" | ||
| on: [push] | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| jobs: | ||
@@ -10,7 +15,7 @@ pytest: | ||
| python-version: ["3.11", "3.12"] | ||
| os: [ubuntu-latest] | ||
| os: ["ubuntu-latest", "windows-latest"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
@@ -17,0 +22,0 @@ python-version: ${{ matrix.python-version }} |
+0
-2
@@ -133,3 +133,1 @@ # Byte-compiled / optimized / DLL files | ||
| # vscode settings | ||
| .vscode/ |
+10
-3
| Metadata-Version: 2.1 | ||
| Name: bomf | ||
| Version: 0.8.1 | ||
| Version: 0.9.1 | ||
| Summary: BO4E Migration Framework | ||
@@ -23,2 +23,11 @@ Home-page: https://github.com/Hochfrequenz/bo4e_migration_framework | ||
| License-File: LICENSE | ||
| Requires-Dist: bo4e | ||
| Requires-Dist: pydantic>=2.0.0 | ||
| Requires-Dist: typeguard>=4.0.1 | ||
| Requires-Dist: frozendict | ||
| Requires-Dist: bidict | ||
| Requires-Dist: networkx | ||
| Requires-Dist: injector | ||
| Requires-Dist: python-generics | ||
| Requires-Dist: pvframework | ||
@@ -114,3 +123,1 @@ # BO4E Migration Framework (bomf) | ||
| You are very welcome to contribute to this template repository by opening a pull request against the main branch. | ||
+0
-1
@@ -1,2 +0,1 @@ | ||
| attrs | ||
| bo4e>=0.5.0 | ||
@@ -3,0 +2,0 @@ pydantic>=2.0.0 |
+9
-12
| # | ||
| # This file is autogenerated by pip-compile with Python 3.11 | ||
| # This file is autogenerated by pip-compile with Python 3.12 | ||
| # by the following command: | ||
@@ -9,4 +9,2 @@ # | ||
| # via pydantic | ||
| attrs==23.1.0 | ||
| # via -r requirements.in | ||
| bidict==0.22.1 | ||
@@ -16,5 +14,5 @@ # via | ||
| # pvframework | ||
| bo4e==0.5.10 | ||
| bo4e==0.6.1 | ||
| # via -r requirements.in | ||
| frozendict==2.3.8 | ||
| frozendict==2.4.0 | ||
| # via | ||
@@ -27,17 +25,17 @@ # -r requirements.in | ||
| # via bo4e | ||
| networkx==3.1 | ||
| networkx==3.2.1 | ||
| # via | ||
| # -r requirements.in | ||
| # pvframework | ||
| pvframework==0.0.2 | ||
| pvframework==0.0.8 | ||
| # via -r requirements.in | ||
| pydantic==2.4.2 | ||
| pydantic==2.6.0 | ||
| # via | ||
| # -r requirements.in | ||
| # bo4e | ||
| pydantic-core==2.10.1 | ||
| pydantic-core==2.16.1 | ||
| # via pydantic | ||
| pyhumps==3.8.0 | ||
| # via bo4e | ||
| python-generics==0.0.2 | ||
| python-generics==0.0.4 | ||
| # via -r requirements.in | ||
@@ -48,6 +46,5 @@ typeguard==4.1.5 | ||
| # pvframework | ||
| typing-extensions==4.7.1 | ||
| typing-extensions==4.9.0 | ||
| # via | ||
| # pydantic | ||
| # pydantic-core | ||
| # typeguard |
+0
-1
@@ -32,3 +32,2 @@ [metadata] | ||
| install_requires = | ||
| attrs | ||
| bo4e | ||
@@ -35,0 +34,0 @@ pydantic>=2.0.0 |
| Metadata-Version: 2.1 | ||
| Name: bomf | ||
| Version: 0.8.1 | ||
| Version: 0.9.1 | ||
| Summary: BO4E Migration Framework | ||
@@ -23,2 +23,11 @@ Home-page: https://github.com/Hochfrequenz/bo4e_migration_framework | ||
| License-File: LICENSE | ||
| Requires-Dist: bo4e | ||
| Requires-Dist: pydantic>=2.0.0 | ||
| Requires-Dist: typeguard>=4.0.1 | ||
| Requires-Dist: frozendict | ||
| Requires-Dist: bidict | ||
| Requires-Dist: networkx | ||
| Requires-Dist: injector | ||
| Requires-Dist: python-generics | ||
| Requires-Dist: pvframework | ||
@@ -114,3 +123,1 @@ # BO4E Migration Framework (bomf) | ||
| You are very welcome to contribute to this template repository by opening a pull request against the main branch. | ||
@@ -1,10 +0,9 @@ | ||
| attrs | ||
| bidict | ||
| bo4e | ||
| pydantic>=2.0.0 | ||
| typeguard>=4.0.1 | ||
| frozendict | ||
| bidict | ||
| networkx | ||
| injector | ||
| networkx | ||
| python-generics | ||
| pvframework | ||
| pydantic>=2.0.0 | ||
| python-generics | ||
| typeguard>=4.0.1 |
@@ -15,2 +15,3 @@ .gitignore | ||
| .github/workflows/coverage.yml | ||
| .github/workflows/dependabot_automerge.yml | ||
| .github/workflows/no_byte_order_mark.yml | ||
@@ -21,2 +22,15 @@ .github/workflows/packaging_test.yml | ||
| .github/workflows/unittests.yml | ||
| .vscode/settings.json | ||
| dev_requirements/requirements-coverage.in | ||
| dev_requirements/requirements-coverage.txt | ||
| dev_requirements/requirements-formatting.in | ||
| dev_requirements/requirements-formatting.txt | ||
| dev_requirements/requirements-linting.in | ||
| dev_requirements/requirements-linting.txt | ||
| dev_requirements/requirements-test_packaging.in | ||
| dev_requirements/requirements-test_packaging.txt | ||
| dev_requirements/requirements-tests.in | ||
| dev_requirements/requirements-tests.txt | ||
| dev_requirements/requirements-type_check.in | ||
| dev_requirements/requirements-type_check.txt | ||
| src/bomf/__init__.py | ||
@@ -23,0 +37,0 @@ src/bomf/config.py |
| """ | ||
| BOMF stands for BO4E Migration Framework. | ||
| """ | ||
| import asyncio | ||
@@ -55,5 +56,5 @@ from abc import ABC | ||
| """ | ||
| self.bo4e_to_target_mapper: Bo4eDataSetToTargetMapper[ | ||
| TargetDataModel, IntermediateDataSet | ||
| ] = bo4e_to_target_mapper | ||
| self.bo4e_to_target_mapper: Bo4eDataSetToTargetMapper[TargetDataModel, IntermediateDataSet] = ( | ||
| bo4e_to_target_mapper | ||
| ) | ||
| """ | ||
@@ -60,0 +61,0 @@ a mapper that transforms bo4e data sets to a structure that suits the target system |
| """ | ||
| This module provides a class to hold configuration values for the `MigrationStrategy`. | ||
| """ | ||
| from datetime import datetime | ||
@@ -5,0 +6,0 @@ |
@@ -29,4 +29,3 @@ """ | ||
| self, source_data_provider: JsonFileSourceDataProvider[Candidate, KeyTyp] | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: | ||
| ... | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: ... | ||
@@ -36,8 +35,6 @@ @overload | ||
| self, source_data_provider: ListBasedSourceDataProvider[Candidate, KeyTyp] | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: | ||
| ... | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: ... | ||
| @overload | ||
| async def apply(self, source_data_provider: ASourceDataProvider) -> ASourceDataProvider: | ||
| ... | ||
| async def apply(self, source_data_provider: ASourceDataProvider) -> ASourceDataProvider: ... | ||
@@ -47,4 +44,3 @@ @overload | ||
| self, source_data_provider: SourceDataProvider[Candidate, KeyTyp] | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: | ||
| ... | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: ... | ||
@@ -54,4 +50,3 @@ @overload | ||
| self, source_data_provider: JsonFileSourceDataProvider[Candidate, KeyTyp], key_selector: Literal[None] | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: | ||
| ... | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: ... | ||
@@ -61,4 +56,3 @@ @overload | ||
| self, source_data_provider: ListBasedSourceDataProvider[Candidate, KeyTyp], key_selector: Literal[None] | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: | ||
| ... | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: ... | ||
@@ -68,4 +62,3 @@ @overload | ||
| self, source_data_provider: SourceDataProvider[Candidate, KeyTyp], key_selector: Literal[None] | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: | ||
| ... | ||
| ) -> SourceDataProvider[Candidate, KeyTyp]: ... | ||
@@ -72,0 +65,0 @@ async def apply( |
| """ | ||
| entity loaders load entities into the target system | ||
| """ | ||
| import asyncio | ||
@@ -11,5 +12,4 @@ import json | ||
| import attrs | ||
| from generics import get_filled_type | ||
| from pydantic import BaseModel, TypeAdapter, ValidationError # pylint:disable=no-name-in-module | ||
| from pydantic import BaseModel, TypeAdapter, ConfigDict, ValidationError # pylint:disable=no-name-in-module | ||
@@ -19,4 +19,3 @@ _TargetEntity = TypeVar("_TargetEntity") | ||
| @attrs.define(auto_attribs=True, kw_only=True) | ||
| class EntityLoadingResult: # pylint:disable=too-few-public-methods | ||
| class EntityLoadingResult(BaseModel): # pylint:disable=too-few-public-methods | ||
| """ | ||
@@ -26,9 +25,9 @@ Information gathered while loading a _TargetEntity into the target system. | ||
| id_in_target_system: Optional[str] = attrs.field( | ||
| validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None | ||
| ) | ||
| model_config = ConfigDict(arbitrary_types_allowed=True) | ||
| id_in_target_system: Optional[str] = None | ||
| """ | ||
| the optional ID of the entity in the target system (e.g. if a new (GU)ID is generated upon loading) | ||
| """ | ||
| polling_task: Optional[Awaitable] = attrs.field(default=None) | ||
| polling_task: Optional[Awaitable] = None | ||
| """ | ||
@@ -41,4 +40,3 @@ If this task is awaited it means, that the target system is done with processing the request. | ||
| @attrs.define(auto_attribs=True, kw_only=True) | ||
| class LoadingSummary(ABC, Generic[_TargetEntity]): # pylint:disable=too-few-public-methods | ||
| class LoadingSummary(BaseModel, ABC, Generic[_TargetEntity]): # pylint:disable=too-few-public-methods | ||
| """ | ||
@@ -49,25 +47,21 @@ Each instance of _TargetEntity that is loaded to the target system results in a LoadingSummary. | ||
| was_loaded_successfully: bool = attrs.field(validator=attrs.validators.instance_of(bool)) | ||
| model_config = ConfigDict(arbitrary_types_allowed=True) | ||
| was_loaded_successfully: bool | ||
| """ | ||
| true iff the instance has been loaded successfully | ||
| """ | ||
| loaded_at: Optional[datetime] = attrs.field( | ||
| validator=attrs.validators.optional(attrs.validators.instance_of(datetime)), default=None | ||
| ) | ||
| loaded_at: Optional[datetime] = None | ||
| """ | ||
| point in time at which the loading (without verification) has completed; if not None | ||
| """ | ||
| verified_at: Optional[datetime] = attrs.field( | ||
| validator=attrs.validators.optional(attrs.validators.instance_of(datetime)), default=None | ||
| ) | ||
| verified_at: Optional[datetime] = None | ||
| """ | ||
| point in time at which the loading of this entity has been verified (or None if not) | ||
| """ | ||
| id_in_target_system: Optional[str] = attrs.field( | ||
| validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None | ||
| ) | ||
| id_in_target_system: Optional[str] = None | ||
| """ | ||
| the optional ID of the entity in the target system (e.g. if a new (GU)ID is generated upon loading) | ||
| """ | ||
| loading_error: Optional[Exception] = attrs.field(default=None) | ||
| loading_error: Optional[Exception] = None | ||
@@ -74,0 +68,0 @@ |
@@ -5,2 +5,3 @@ """ | ||
| """ | ||
| import logging | ||
@@ -7,0 +8,0 @@ from contextvars import ContextVar, Token |
| """ | ||
| mappers convert from source data model to BO4E and from BO4E to a target data model | ||
| """ | ||
| import asyncio | ||
@@ -5,0 +6,0 @@ import logging |
| """ | ||
| general data models for migrations | ||
| """ | ||
| import enum | ||
@@ -9,3 +10,2 @@ import uuid | ||
| import attrs | ||
| from bo4e.bo.geschaeftsobjekt import Geschaeftsobjekt | ||
@@ -29,4 +29,3 @@ from bo4e.com.com import COM | ||
| # pylint:disable=too-few-public-methods | ||
| @attrs.define(kw_only=True, auto_attribs=True) | ||
| class BusinessObjectRelation: | ||
| class BusinessObjectRelation(BaseModel): | ||
| """ | ||
@@ -41,3 +40,3 @@ A business object relation describes the relation between two business object. | ||
| relation_type: enum.Enum = attrs.field() | ||
| relation_type: enum.Enum | ||
| """ | ||
@@ -53,3 +52,3 @@ The relation type describes how two business objects relate to each other. | ||
| """ | ||
| relation_part_a: Bo4eTyp = attrs.field() | ||
| relation_part_a: Bo4eTyp | ||
| """ | ||
@@ -59,3 +58,3 @@ one Business Object or COM | ||
| relation_part_b: Bo4eTyp = attrs.field() | ||
| relation_part_b: Bo4eTyp | ||
| """ | ||
@@ -62,0 +61,0 @@ another Business Object or COM |
| """ | ||
| providers provide data | ||
| """ | ||
| import json | ||
@@ -5,0 +6,0 @@ import logging |
+11
-15
@@ -16,6 +16,4 @@ [tox] | ||
| deps = | ||
| -rrequirements.txt | ||
| pytest | ||
| pytest-asyncio | ||
| pytest-datafiles | ||
| -r requirements.txt | ||
| -r dev_requirements/requirements-tests.txt | ||
| setenv = PYTHONPATH = {toxinidir}/src | ||
@@ -27,4 +25,4 @@ commands = python -m pytest --basetemp={envtmpdir} {posargs} | ||
| deps = | ||
| -rrequirements.txt | ||
| pylint | ||
| -r requirements.txt | ||
| -r dev_requirements/requirements-linting.txt | ||
| # add your fixtures like e.g. pytest_datafiles here | ||
@@ -40,7 +38,5 @@ setenv = PYTHONPATH = {toxinidir}/src | ||
| deps = | ||
| -rrequirements.txt | ||
| -r requirements.txt | ||
| {[testenv:tests]deps} | ||
| mypy | ||
| types-frozendict | ||
| networkx-stubs | ||
| -r dev_requirements/requirements-type_check.txt | ||
| commands = | ||
@@ -55,3 +51,4 @@ mypy --show-error-codes --check-untyped-defs src/bomf | ||
| {[testenv:tests]deps} | ||
| coverage | ||
| -r requirements.txt | ||
| -r dev_requirements/requirements-coverage.txt | ||
| setenv = PYTHONPATH = {toxinidir}/src | ||
@@ -66,4 +63,4 @@ commands = | ||
| deps = | ||
| build | ||
| twine | ||
| -r requirements.txt | ||
| -r dev_requirements/requirements-test_packaging.txt | ||
| commands = | ||
@@ -80,4 +77,3 @@ python -m build | ||
| {[testenv:coverage]deps} | ||
| black | ||
| isort | ||
| -r dev_requirements/requirements-formatting.txt | ||
| pip-tools | ||
@@ -84,0 +80,0 @@ pre-commit |
| from typing import Optional, Type | ||
| import attrs | ||
| from pydantic import BaseModel | ||
| import pytest # type:ignore[import] | ||
@@ -18,6 +18,5 @@ from bo4e.bo.marktlokation import Marktlokation | ||
| @attrs.define(kw_only=True, auto_attribs=True) | ||
| class _MaLoAndMeLo(_NotImplementedBo4eDataSetMixin): | ||
| malo: Marktlokation = attrs.field() | ||
| melo: Messlokation = attrs.field() | ||
| class _MaLoAndMeLo(BaseModel, _NotImplementedBo4eDataSetMixin): | ||
| malo: Marktlokation | ||
| melo: Messlokation | ||
@@ -24,0 +23,0 @@ def get_business_object(self, bo_type: Type[Bo4eTyp], specification: Optional[str] = None) -> Bo4eTyp: |
| """ | ||
| Tests the overall data flow using bomf. | ||
| """ | ||
| from datetime import UTC, datetime | ||
@@ -5,0 +6,0 @@ from typing import Optional |
@@ -27,5 +27,4 @@ import logging | ||
| @pytest.mark.datafiles("./unittests/example_source_data.json") | ||
| async def test_json_file_provider(self, datafiles): | ||
| file_path = datafiles / Path("example_source_data.json") | ||
| async def test_json_file_provider(self): | ||
| file_path = Path(__file__).parent / Path("example_source_data.json") | ||
| example_json_data_provider = JsonFileSourceDataProvider( | ||
@@ -32,0 +31,0 @@ file_path, |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
114854
5.03%61
29.79%1553
-0.83%