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

[bug] Blocks object not visible / importable #9998

Closed
KerstinKeller opened this issue Nov 10, 2021 · 2 comments · Fixed by #10026
Closed

[bug] Blocks object not visible / importable #9998

KerstinKeller opened this issue Nov 10, 2021 · 2 comments · Fixed by #10026
Assignees
Milestone

Comments

@KerstinKeller
Copy link

KerstinKeller commented Nov 10, 2021

The documentation suggests, if you want to extend CMakeToolchain with custom blocks, you need to inherit from it.
However, it cannot be imported:

from conan.tools.cmake import CMakeToolchain, CMake, Block

fails with

ImportError: cannot import name 'Block' from 'conan.tools.cmake'

This can be fixed by adding it to the __init__.py (file)[https://github.com/conan-io/conan/blob/1.42.1/conan/tools/cmake/init.py].

Environment Details (include every applicable attribute)

  • Conan 1.42.1:
@memsharded memsharded self-assigned this Nov 10, 2021
@memsharded memsharded added this to the 1.43 milestone Nov 10, 2021
@memsharded
Copy link
Member

Yes, this is a bug, unittesting skipped it because of internal import.

For the external interface, probably it deserves a better, specific name, like CMakeToolchainBlock

@memsharded
Copy link
Member

Fixed in #10026, will be in 1.43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants