Skip to content

Commit

Permalink
ignore mypy for now
Browse files Browse the repository at this point in the history
Run tox -e type_check
type_check: install_deps> python -I -m pip install './.[type_check]' '.[tests]' -r requirements.txt
type_check: freeze> python -m pip freeze --all
type_check: aioauth-client==0.29.0,aiodns==3.2.0,aiohappyeyeballs==2.4.4,aiohttp==3.11.11,aioresponses==0.7.7,aiosignal==1.3.2,annotated-types==0.7.0,anyio==4.8.0,attrs==24.3.0,bo4e==202401.2.1,Brotli==1.1.0,certifi==2024.12.14,cffi==1.17.1,frozenlist==1.5.0,h11==0.14.0,httpcore==1.0.7,httpx==0.28.1,idna==3.10,iniconfig==2.0.0,iso3166==2.1.1,jsonpatch==1.33,jsonpointer==3.0.0,more-itertools==10.5.0,multidict==6.1.0,mypy==1.14.1,mypy-extensions==1.0.0,packaging==24.2,pip==24.3.1,pluggy==1.5.0,propcache==0.2.1,pycares==4.5.0,pycparser==2.22,pydantic==2.10.5,pydantic_core==2.27.2,pyhumps==3.8.0,PyJWT==2.10.1,pytest==8.3.4,pytest-asyncio==0.25.2,sniffio==1.3.1,tmdsclient @ file:///home/runner/work/tmdsclient.py/tmdsclient.py,types-pytz==2024.2.0.20241221,typing_extensions==4.12.2,yarl==1.18.3
type_check: commands[0]> mypy --show-error-codes src/tmdsclient --strict
src/tmdsclient/models/marktlokation.py:37: error: Signature of "__replace__" incompatible with supertype "Marktlokation"  [override]
src/tmdsclient/models/marktlokation.py:37: note:      Superclass:
src/tmdsclient/models/marktlokation.py:37: note:          def __replace__(*, version: str | None = ..., typ: Typ | None = ..., zusatz_attribute: list[ZusatzAttribut] | None = ..., id: str | None = ..., marktlokations_id: str | None = ..., sparte: Sparte | None = ..., energierichtung: Energierichtung | None = ..., bilanzierungsmethode: Bilanzierungsmethode | None = ..., netzebene: Netzebene | None = ..., verbrauchsart: Verbrauchsart | None = ..., ist_unterbrechbar: bool | None = ..., netzbetreibercodenr: str | None = ..., gebietstyp: Gebiettyp | None = ..., netzgebietsnr: str | None = ..., bilanzierungsgebiet: str | None = ..., grundversorgercodenr: str | None = ..., gasqualitaet: Gasqualitaet | None = ..., endkunde: Geschaeftspartner | None = ..., zugehoerige_messlokation: Messlokationszuordnung | None = ..., lokationsadresse: Adresse | None = ..., geoadresse: Geokoordinaten | None = ..., katasterinformation: Katasteradresse | None = ..., kundengruppen: list[Kundentyp] | None = ..., regelzone: str | None = ..., marktgebiet: str | None = ..., zaehlwerke: list[Zaehlwerk] | None = ..., verbrauchsmengen: list[Verbrauch] | None = ..., zaehlwerke_der_beteiligten_marktrolle: list[Zaehlwerk] | None = ...) -> Marktlokation
src/tmdsclient/models/marktlokation.py:37: note:      Subclass:
src/tmdsclient/models/marktlokation.py:37: note:          def __replace__(*, version: str | None = ..., typ: Typ | None = ..., zusatz_attribute: list[ZusatzAttribut] | None = ..., id: str | None = ..., marktlokations_id: str | None = ..., sparte: Sparte | None = ..., energierichtung: Energierichtung | None = ..., bilanzierungsmethode: Bilanzierungsmethode | None = ..., netzebene: Netzebene | None = ..., verbrauchsart: Verbrauchsart | None = ..., ist_unterbrechbar: bool | None = ..., netzbetreibercodenr: str | None = ..., gebietstyp: Gebiettyp | None = ..., netzgebietsnr: str | None = ..., bilanzierungsgebiet: str | None = ..., grundversorgercodenr: str | None = ..., gasqualitaet: Gasqualitaet | None = ..., endkunde: Geschaeftspartner | None = ..., zugehoerige_messlokation: Messlokationszuordnung | None = ..., lokationsadresse: Adresse | None = ..., geoadresse: Geokoordinaten | None = ..., katasterinformation: Katasteradresse | None = ..., kundengruppen: list[Kundentyp] | None = ..., regelzone: str | None = ..., marktgebiet: str | None = ..., zaehlwerke: list[Zaehlwerk] | None = ..., verbrauchsmengen: list[Verbrauch] | None = ..., zaehlwerke_der_beteiligten_marktrolle: list[Zaehlwerk] | None = ..., netznutzungsabrechnungsdaten: list[_Netznutzungsabrechnungsdaten] | None = ...) -> Bo4eMarktlokationWithNetznutzungsabrechnungsdaten
src/tmdsclient/models/messlokation.py:23: error: Argument 5 of "__replace__" is incompatible with supertype "Messlokation"; supertype defines the argument type as "str | None"  [override]
src/tmdsclient/models/messlokation.py:23: note: This violates the Liskov substitution principle
src/tmdsclient/models/messlokation.py:23: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Found 2 errors in 2 files (checked 22 source files)
type_check: exit 1 (7.87 seconds) /home/runner/work/tmdsclient.py/tmdsclient.py> mypy --show-error-codes src/tmdsclient --strict pid=2014
  type_check: FAIL code 1 (19.54=setup[11.67]+cmd[7.87] seconds)
  evaluation failed :( (19.61 seconds)
  • Loading branch information
Konstantin committed Jan 13, 2025
1 parent 9b626f3 commit 17860aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tmdsclient/models/marktlokation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Bilanzierungsmethode(StrEnum):
IMS = "IMS" # see https://github.com/bo4e/BO4E-python/pull/921


class Bo4eMarktlokationWithNetznutzungsabrechnungsdaten(Bo4eMarktlokation):
class Bo4eMarktlokationWithNetznutzungsabrechnungsdaten(Bo4eMarktlokation): # type:ignore[override]
"""
similar to the bo4e marktlokation but with a list of Netznutzungsabrechnungsdaten
"""
Expand Down
2 changes: 1 addition & 1 deletion src/tmdsclient/models/messlokation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


# pylint:disable=missing-function-docstring
class Bo4eMeLoWithoutIdValidation(Bo4eMesslokation):
class Bo4eMeLoWithoutIdValidation(Bo4eMesslokation): # type:ignore[override]
"""
Similar to bo4e messlokation but with no regex validation on the messlokations_id.
The reason is that the IS-U water melo IDs do not match the regex. 🙄
Expand Down

0 comments on commit 17860aa

Please sign in to comment.