conanfile.py
Reference for conanfile.py: attributes, methods, etc.
Important
conanfile.py recipes uses a variety of attributes and methods to operate. In order to avoid collisions and conflicts, follow these rules:
Public attributes and methods, like
build()
,self.package_folder
, are reserved for Conan. Don’t use public members for custom fields or methods in the recipes.Use “protected” access for your own members, like
self._my_data
ordef _my_helper(self):
. Conan only reserves “protected” members starting with_conan
.
Contents:
- Attributes
- name
- version
- description
- homepage
- url
- license
- author
- topics
- user, channel
- default_user, default_channel
- settings
- options
- default_options
- requires
- tool_requires
- exports
- exports_sources
- generators
- should_configure, should_build, should_install, should_test
- build_policy
- short_paths
- no_copy_source
- source_folder
- install_folder
- build_folder
- package_folder
- recipe_folder
- cpp_info
- deps_cpp_info
- env_info
- deps_env_info
- user_info
- deps_user_info
- user_info_build
- info
- apply_env
- in_local_cache
- develop
- keep_imports
- scm
- revision_mode
- python_requires (legacy)
- python_requires
- python_requires_extend
- conan_data
- deprecated
- provides
- conf
- win_bash
- test_type
- Methods
- source()
- build()
- package()
- package_info()
- set_name(), set_version()
- configure(), config_options()
- validate()
- validate_build()
- requirements()
- build_requirements()
- system_requirements()
- imports()
- package_id()
- build_id()
- compatibility()
- deploy()
- init()
- export()
- export_sources()
- generate()
- layout()
- test()
- tools
- Dependencies
- Python requires
- Output and Running