Skip to content
/ hooks Public
forked from conan-io/hooks

Official Conan client hooks

License

Notifications You must be signed in to change notification settings

lasote/hooks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Build status

Conan Hooks

Repository to develop experimental Conan hooks for Conan >= 1.8.

WARNING: Hooks were originally named "Plugins"

Hook setup

Place your hook Python files under ~/.conan/hooks. The name of the hook would be the same one as the file name.

*~/.conan/hook/conan-center.py

Only copying hook files will not activate them.

Conan config as installer

To install all hooks from Conan repository in Github:

$ conan config install https://github.com/conan-io/hooks.git

If you are using Conan >=1.14 you can specify the source and destination folder to avoid copying undesired files to your local cache:

$ conan config install https://github.com/conan-io/hooks -sf hooks -tf hooks

Conan config install does not activate any hook.

Hook activation

You can activate any hook with:

$ conan config set hooks.conan-center

If you handle multiple dependencies in your project is better to add a conan.conf:

    [hooks]
    attribute_checker
    conan-center_reviewer

Hooks

These are the hooks currently available in this repository

This hook does checks for the inclusion guidelines of third-party libraries in Conan Center.

It is mostly intended for users who want to contribute packages to Conan Center. With this hook they will test some of the requirements in the guidelines, as this hook will check for recipe metadata, binary matching... during the conan create step and will output the result of each check as OK, WARNING or ERROR:

[HOOK - conan-center_reviewer.py] pre_export(): [RECIPE METADATA] OK
[HOOK - conan-center_reviewer.py] pre_export(): [HEADER ONLY] OK
[HOOK - conan-center_reviewer.py] pre_export(): [NO COPY SOURCE] OK
[HOOK - conan-center_reviewer.py] pre_export(): [FPIC OPTION] OK
[HOOK - conan-center_reviewer.py] pre_export(): [FPIC MANAGEMENT] 'fPIC' option not found
[HOOK - conan-center_reviewer.py] pre_export(): [VERSION RANGES] OK
[HOOK - conan-center_reviewer.py] post_package(): ERROR: [PACKAGE LICENSE] No package licenses found in: ~/
.conan/data/name/version/jgsogo/test/package/3475bd55b91ae904ac96fde0f106a136ab951a5e. Please
 package the library license to a 'licenses' folder
[HOOK - conan-center_reviewer.py] post_package(): [DEFAULT PACKAGE LAYOUT] OK
[HOOK - conan-center_reviewer.py] post_package(): [MATCHING CONFIGURATION] OK
[HOOK - conan-center_reviewer.py] post_package(): [SHARED ARTIFACTS] OK

If you want the hook to fail the execution, if an error is reported, you can adjust the environment variable CONAN_HOOK_ERROR_LEVEL:

  • CONAN_HOOK_ERROR_LEVEL=40 it will raise if any error happen.
  • CONAN_HOOK_ERROR_LEVEL=30 it will raise if any error or warning happen.

This hook checks that some important attributes are present in the ConanFile: url, license and description, and will output a warning for the missing ones.

This Conan hook reads your recipe and updates its Bintray package info using the attributes.

It's necessary pass Bintray login by environment variables:

  • BINTRAY_LOGIN_USERNAME: Bintray login username
  • BINTRAY_PASSWORD: Bintray API KEY

The hook is automatically called when upload command is executed.

This Conan hook validates produced binary artifacts of the given package.

Binaries stored in the package folder are checked for compatibility with package settings and options.

Currently, the following checks are performed:

  • Binary format (Mach-O, ELF or PE)
  • Architecture
  • No shared libraries are produced for shared=False
  • Visual Studio runtime library in use

The hook uses LIEF library in order to perform its checks.

The hook is automatically called when package command is executed.

This Conan hook reads your recipe and updates its GitHub repository properties using the attributes.

The following attributes are updated:

  • homepage

  • description

  • topics

It's necessary to pass GitHub token by environment variable: GITHUB_TOKEN.

This Conan hook validates that conanfile's license attribute specifies valid license identifier(s) from the SPDX license list.

The hook uses spdx_lookup python module in order to perform its checks.

Use pip install spdx_lookup in order to install required dependency.

The hook is automatically called when export command is executed.

License

MIT License

About

Official Conan client hooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Shell 1.1%