Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'pop from an empty set' #202

Closed
virtuald opened this issue Nov 26, 2023 · 4 comments
Closed

KeyError: 'pop from an empty set' #202

virtuald opened this issue Nov 26, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@virtuald
Copy link
Contributor

Not sure how this happened, but here's the stack trace in pybind11-stubgen 2.4.1:

pybind11_stubgen - [WARNING] Enum-like str representations were found with no matching mapping to the enum class location.
Use `--enum-class-locations` to specify full path to the following enum(s):
 - EncodingType
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "robotpy_build/command/build_pyi.py", line 167, in <module>
    main()
  File "robotpy_build/command/build_pyi.py", line 163, in main
    pybind11_stubgen.main()
  File "pybind11_stubgen/__init__.py", line 317, in main
    run(
  File "pybind11_stubgen/__init__.py", line 358, in run
    parser.finalize()
  File "pybind11_stubgen/parser/mixins/error_handlers.py", line 61, in finalize
    return super().finalize()
           ^^^^^^^^^^^^^^^^^^
  File "pybind11_stubgen/parser/mixins/fix.py", line 1155, in finalize
    value, import_ = self._repr_to_value_and_import[repr_].pop()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'pop from an empty set'
@sizmailov sizmailov added the bug Something isn't working label Nov 27, 2023
@sizmailov
Copy link
Owner

Thanks for the report!

Now I'm looking closer to #196, there are a few problems there. I'll not be able to quickly address it. I'm thinking of reverting #196, unfortunately.

@sizmailov
Copy link
Owner

Should be solved by #203

@ringohoffman
Copy link
Contributor

@virtuald for my understanding of the origin of this bug... were you using --enum-class-locations when this error occurred? Does it still occur even when you don't use it? (using v2.4.1)

@virtuald
Copy link
Contributor Author

virtuald commented Dec 7, 2023

@ringohoffman I did not specify --enum-class-locations. I have an automated binding tool called robotpy-build which calls stubgen to generate pyi files (see https://github.com/robotpy/robotpy-build/blob/main/robotpy_build/command/build_pyi.py#L152).

I was likely building https://github.com/robotpy/mostrobotpy/ ... but I'm not 100% sure which one of the subprojects I was building. You can do RPYBUILD_PARALLEL=1 ./rdev.sh ci run to build all of the projects, it takes awhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants