Code Monkey home page Code Monkey logo

Comments (6)

pawamoy avatar pawamoy commented on August 25, 2024 1

Yes I'm still using Python 3.12.0rc1, good catch! Will upgrade 🙂

from griffe.

pawamoy avatar pawamoy commented on August 25, 2024 1

I eventually made use of pysource_minimize, thank you again for showing me how to use it 🙂

from griffe.

pawamoy avatar pawamoy commented on August 25, 2024

The SystemErrors seem to come from pysource_codegen itself:

Failing case with seed 538993
Traceback (most recent call last):
  File "/media/data/dev/griffe/duties.py", line 325, in test_seed
    visit("module", filepath=Path("/tmp/module.py"), code=generate(seed))
                                                          ^^^^^^^^^^^^^^
  File "/media/data/dev/griffe/__pypackages__/3.12/lib/pysource_codegen/_codegen.py", line 930, in generate
    tree = generator.generate(root_node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/griffe/__pypackages__/3.12/lib/pysource_codegen/_codegen.py", line 886, in generate
    result = fix(result, parents)
             ^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/griffe/__pypackages__/3.12/lib/pysource_codegen/_codegen.py", line 752, in fix
    compile(code, "<string>", "exec", dont_inherit=True)
SystemError: compiler_lookup_arg(name='name_1') with reftype=3 failed in <generic parameters of name_0>; freevars of code name_0: ('.type_params', 'name_1', 'name_3', 'name_4')

We will ignore them for now.

from griffe.

pawamoy avatar pawamoy commented on August 25, 2024

Erm, it looks like I can't regenerate the same code when debugging through VSCode... 😮‍💨

from griffe.

pawamoy avatar pawamoy commented on August 25, 2024

Oh, OK, it actually depended on the Python version used.

from griffe.

15r10nk avatar 15r10nk commented on August 25, 2024

Yes, it depends on the python version. Are you still using a 3.12 pre-release? This errors looking familiar to me. python/cpython#109219

I put an quick implementation together based on your tweet which finds some errors #216.
the pysource-minimize part is the important part here which gives you this nice small source codes.

Let me know how you want to integrate it.
You can also take it from here if you want.

from griffe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.