[BUG] import errors
unixorn opened this issue · 3 comments
unixorn commented
Describe the bug
Merged #15 , was going to work on #28 and ran into an import error before I made any changes.
@mion00, what python version are you using? I'm ok with bumping the required python version if that's what it takes to fix this.
To Reproduce
❯ poetry run python3
Python 3.9.16 (main, Dec 7 2022, 10:16:11)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ha_mqtt_discoverable import __version__ as vers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jpb/Dropbox/s/hass/ha-mqtt-discoverable/ha_mqtt_discoverable/__init__.py", line 457, in <module>
class DeviceInfo(BaseModel):
File "/Users/jpb/Dropbox/s/hass/ha-mqtt-discoverable/ha_mqtt_discoverable/__init__.py", line 467, in DeviceInfo
identifiers: Optional[list[str] | str] = None
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'type'
>>>
mion00 commented
Sorry I didn't know what Python version we were targeting.
Locally I am on 3.10.
…On Thu, Feb 23, 2023, 03:32 Joe Block ***@***.***> wrote:
Describe the bug
Merged #15 <#15> , was
going to work on #28
<#28> and ran into an
import error before I made any changes.
@mion00 <https://github.com/mion00>, what python version are you using?
I'm ok with bumping the required python version if that's what it takes to
fix this.
To Reproduce
❯ poetry run python3
Python 3.9.16 (main, Dec 7 2022, 10:16:11)
[Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ha_mqtt_discoverable import __version__ as vers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jpb/Dropbox/s/hass/ha-mqtt-discoverable/ha_mqtt_discoverable/__init__.py", line 457, in <module>
class DeviceInfo(BaseModel):
File "/Users/jpb/Dropbox/s/hass/ha-mqtt-discoverable/ha_mqtt_discoverable/__init__.py", line 467, in DeviceInfo
identifiers: Optional[list[str] | str] = None
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'type'
>>>
—
Reply to this email directly, view it on GitHub
<#32>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCNHN7NHN6HSROM7FMSDA3WY3D5HANCNFSM6AAAAAAVFCCNZU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
unixorn commented
I'll switch to 3.10 and document that in the readme.
unixorn commented
I should have realized it needed 3.10 since the Dockerfile was updated to use python:3.10