Skip to content
Snippets Groups Projects

Fix execution for Python 3.11

Merged Stephan Seitz requested to merge seitz/pystencils:python-11.1 into master
2 unresolved threads

Fixes execution on Python 3.11

Prevents the following error:

ImportError while loading conftest '/home/stephan/projects/pystencils/conftest.py'.
conftest.py:14: in <module>
    from pystencils.cpu import cpujit
pystencils/__init__.py:10: in <module>
    from .config import CreateKernelConfig
pystencils/config.py:19: in <module>
    @dataclass
/usr/lib/python3.11/dataclasses.py:1220: in dataclass
    return wrap(cls)
/usr/lib/python3.11/dataclasses.py:1210: in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
/usr/lib/python3.11/dataclasses.py:958: in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
/usr/lib/python3.11/dataclasses.py:815: in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
E   ValueError: mutable default <class 'mappingproxy'> for field gpu_indexing_params is not allowed: use default_factory

I just did as I was told by Python :shrug:

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
121 121 allow_double_writes: bool = False
122 122 """
123 123 If True, don't check if every field is only written at a single location. This is required
124 for example for kernels that are compiled with loop step sizes > 1, that handle multiple
    • The version string test fails, unfortunately... It is a rather artificial test to ensure basic functioning. Could you please look at it to make the pipeline green

    • Author Maintainer

      The test for version 1.0 should be removed. It just say that my forks is missing tags from the main repo. I assume that all future forks will fork after the release/1.0.0 and that Gitlab forks will inherit tags at the moment of fork like Github. Otherwise, the test failure is suprising.

      Edited by Stephan Seitz
    • Please register or sign in to reply
  • Stephan Seitz added 5 commits

    added 5 commits

    • 373c033d...8cc89044 - 4 commits from branch pycodegen:master
    • bbcefe16 - fix: MappingProxyType is not a constant and should therefor use default_factory

    Compare with previous version

  • Markus Holzer approved this merge request

    approved this merge request

  • merged

  • Markus Holzer mentioned in commit 381c3e09

    mentioned in commit 381c3e09

  • Please register or sign in to reply
    Loading