scratchattach icon indicating copy to clipboard operation
scratchattach copied to clipboard

[Bug]: Importing library fails

Open TimMcCool opened this issue 2 months ago • 5 comments

scratchattach version

2.1.14

What happened?

Importing the library fails

System: Ubuntu Python version: 3.10 importing scratchattach v2.1.13 works I deleted the 2.1.14 release from PyPi

Your code.

import scratchattach as sa

Traceback

File "/root/scratchbackends/app.py", line 8, in <module>
    import scratchattach as sa
  File "/usr/local/lib/python3.10/dist-packages/scratchattach/__init__.py", line 29, in <module>
    from . import editor
  File "/usr/local/lib/python3.10/dist-packages/scratchattach/editor/__init__.py", line 5, in <module>
    from .asset import Asset, Costume, Sound
  File "/usr/local/lib/python3.10/dist-packages/scratchattach/editor/asset.py", line 7, in <module>
    from . import base, commons, sprite, build_defaulting
  File "/usr/local/lib/python3.10/dist-packages/scratchattach/editor/base.py", line 19, in <module>
    from . import build_defaulting
  File "/usr/local/lib/python3.10/dist-packages/scratchattach/editor/build_defaulting.py", line 13, in <module>
    class _SetSprite(commons.Singleton):
  File "/usr/lib/python3.10/enum.py", line 173, in __prepare__
    member_type, first_enum = metacls._get_mixins_(cls, bases)
  File "/usr/lib/python3.10/enum.py", line 619, in _get_mixins_
    raise TypeError("new enumerations should be created as "
TypeError: new enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`

TimMcCool avatar Nov 02 '25 05:11 TimMcCool

that's because of the python version. 3.12 should work. this is an issue that has occurred before #469

faretek1 avatar Nov 02 '25 09:11 faretek1

What's the minimum python version we want to support?

faretek1 avatar Nov 02 '25 09:11 faretek1

I think we have to just set Singleton to Enum for it to work on all versions...

TheCommCraft avatar Nov 02 '25 09:11 TheCommCraft

It should work now

TheCommCraft avatar Nov 02 '25 09:11 TheCommCraft

I am going to deploy it as 2.1.15 soon if there are no more errors

TheCommCraft avatar Nov 05 '25 06:11 TheCommCraft

I am going to deploy it as 2.1.15 soon if there are no more errors

Does it work? If so, this issue can be closed.

faretek1 avatar Nov 20 '25 19:11 faretek1