sip: exception when trying to use generate-extracts

Scott Talbert swt at techie.net
Wed May 25 01:59:04 BST 2022


On Tue, 24 May 2022, Scott Talbert wrote:

> On Tue, 24 May 2022, Scott Talbert wrote:
>
>>>>> Hi Phil,
>>>>> 
>>>>> I'm working on trying to build wxPython with sip 6.6.1.  When setting
>>>>> generate-extracts in pyproject.toml, I'm seeing this exception:
>>>>> 
>>>>> Traceback (most recent call last):
>>>>>   File "/home/talbert/wxPython/Phoenix.sip6/env/bin/sip-build", line
>>>>> 8, in <module>
>>>>>     sys.exit(main())
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/tools/build.py",
>>>>> line 37, in main
>>>>>     handle_exception(e)
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/exceptions.py",
>>>>> line 81, in handle_exception
>>>>>     raise e
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/tools/build.py",
>>>>> line 34, in main
>>>>>     project.build()
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/project.py",
>>>>> line 244, in build
>>>>>     self.builder.build()
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/builder.py",
>>>>> line 48, in build
>>>>>     self._generate_bindings()
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/builder.py",
>>>>> line 277, in _generate_bindings
>>>>>     buildable = bindings.generate()
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/bindings.py",
>>>>> line 166, in generate
>>>>>     spec, sip_files = parse(self.sip_file, SIP_VERSION, encoding,
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/generator/parser/parser.py",
>>>>> line 35, in parse
>>>>>     protected_is_public, include_dirs, strict).parse(sip_file)
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/generator/parser/parser_manager.py",
>>>>> line 1490, in parse
>>>>>     self._parser.parse(self._read(sip_file, raw_sip_file),
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/ply/yacc.py",
>>>>> line 331, in parse
>>>>>     return self.parseopt(input, lexer, debug, tracking, tokenfunc)
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/ply/yacc.py",
>>>>> line 823, in parseopt
>>>>>     p.callable(pslice)
>>>>>   File
>>>>> "/home/talbert/wxPython/Phoenix.sip6/env/lib64/python3.10/site-packages/sipbuild/generator/parser/rules.py",
>>>>> line 551, in p_extract
>>>>>     pm.module_state.module.extracts.append(Extract(id, order, part))
>>>>> AttributeError: 'Module' object has no attribute 'extracts'
>>>> 
>>>> Should be fixed in the next snapshot. I'd suggest you work with the 
>>>> snapshots at the moment as they have quite a few fixes. I'm happy to hold 
>>>> off from the next release until you are happy with them.
>>> 
>>> Thanks Phil.  I'll continue testing with the snapshots and let you know if 
>>> I run into any more issues.
>> 
>> Actually - is there a new snapshot?  The latest seems to be from 16 May.
>
> Nevermind about the snapshot - I just patched my local copy.
>
> The next issue I'm running into: the parser seems to be complaining about a 
> property that has the same name as the class it is in:
>
> sip-build: /home/talbert/wxPython/Phoenix.sip6/sip/gen/intl.sip: line 1014 
> column 7: there is already a property in scope called 'Locale'
>
> Line 1014 is:
> class wxLocale
>
> I've attached the full .sip file.  BTW, wxPython uses
> %AutoPyName(remove_leading="wx") so the class name ends up as Locale.
>
> I'll comment out this property for now.

Next, I'm a bit stumped:

These bindings will be built: _core.
Generating the _core bindings...
sip-build: ::T has not been defined

I'm not really sure what this error is complaining about - and I can't 
even that error message in the sip code - do you have any idea where it's 
coming from?

There isn't anything called "T" in any wxPython .sip file that I can see. 
There is a macro used, named wxT(), but that's only used inside blocks 
like %TypeCode.  Is sip parsing those now and it's possibly finding it 
there?

Thanks,
Scott


More information about the PyQt mailing list