You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a 3rd-party library as part of my CI process, and since github updated their mac image to include python 3.11.1 it is breaking. It worked fine in 3.11.0.
The 3rd-party tool is in pip; codemagic-cli-tools. When importing, it fails when declaring an enum. This can be reproduced by running from codemagic.tools import Keychain after installing version 0.36.4.
As near as I can tell, a class inheriting NamedTuple is being interpreted as a tuple when declared as part of an enum. When declared elsewhere it doesn't seem to exhibit this behaviour.
I've managed to reproduce this with a much more minimal example; when you run the following:
importenumfromtypingimportNamedTupleclassNT(NamedTuple):
s: strnt0=NT(s="s0")
nt0._replace(s="other") # this is validclassE(enum.Enum):
nt1=NT(s="s1")
nt2=nt1._replace(s="s2")
it fails with the error AttributeError: 'tuple' object has no attribute '_replace' in python 3.11.1 but not python 3.11.0.
If it this is in fact just incorrect python, fair enough - I'll open a bug against the codemagic-cli-tools library, but this does seem like unexpected behaviour to me.
Your environment
Python 3.11.1; I reproduced this in the docker image python:3.11.1. In the docker image python:3.11.0 the code above produces no errors.
CPython versions tested on: 3.11.1, 3.11.0
Operating system and architecture: macos x64, but run in docker
The text was updated successfully, but these errors were encountered:
Bug report
I'm using a 3rd-party library as part of my CI process, and since github updated their mac image to include python 3.11.1 it is breaking. It worked fine in 3.11.0.
The 3rd-party tool is in pip;
codemagic-cli-tools
. When importing, it fails when declaring an enum. This can be reproduced by runningfrom codemagic.tools import Keychain
after installing version 0.36.4.As near as I can tell, a class inheriting
NamedTuple
is being interpreted as atuple
when declared as part of an enum. When declared elsewhere it doesn't seem to exhibit this behaviour.I've managed to reproduce this with a much more minimal example; when you run the following:
it fails with the error
AttributeError: 'tuple' object has no attribute '_replace'
in python 3.11.1 but not python 3.11.0.If it this is in fact just incorrect python, fair enough - I'll open a bug against the codemagic-cli-tools library, but this does seem like unexpected behaviour to me.
Your environment
Python 3.11.1; I reproduced this in the docker image python:3.11.1. In the docker image python:3.11.0 the code above produces no errors.
The text was updated successfully, but these errors were encountered: