Generic Conan recipes for CMake and Python projects.
Project description
Generic Conan recipes for C/C++ and Python projects.
C/C++
If your project
uses CMake,
and installs a package configuration file
that defines the variable <PACKAGE_NAME>_COMPONENTS
with a list of components,
and for each of them defines a target <package_name>::<component>,
then you should be able to copy this recipe to package it for Conan:
from conans import python_requires
CMakeConanFile = python_requires('autorecipes/[*]@jfreeman/testing').cmake()
class Recipe(CMakeConanFile):
name = CMakeConanFile.__dict__['name']
version = CMakeConanFile.__dict__['version']
Python
If your project
then you should be able to copy this recipe to package it for Conan:
from conans import python_requires
PythonConanFile = python_requires('autorecipes/[*]@jfreeman/testing').python()
class Recipe(PythonConanFile):
name = PythonConanFile.__dict__['name']
version = PythonConanFile.__dict__['version']
FAQ
Why do I need to copy the name and version attributes from the base class?
Conan parses the recipe looking for the name and version attributes, instead of just executing it. Thus, we must copy the attributes to move past that check.
Further, these attributes are descriptors. Accessing them with dot notation, like CMakeConanFile.name, evaluates them against the class CMakeConanFile instead of your recipe, but they need the most derived type to work correctly.
Can I override some attributes?
Yes. These base classes just provide default values.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file autorecipes-0.2.0.tar.gz
.
File metadata
- Download URL: autorecipes-0.2.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0a3 CPython/3.6.8+ Linux/4.15.0-52-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd57e472b30a366e612ef52bc954e7c69b3e7a25150941aa30a3a95cf4337a92 |
|
MD5 | b8f8a921e26aa0b1be09e635fbb4be04 |
|
BLAKE2b-256 | 248cdb4680f4266f6bc4a31fe2d07fd8180394bd78fc0cdb51e52c932abf80a2 |
Provenance
File details
Details for the file autorecipes-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: autorecipes-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0a3 CPython/3.6.8+ Linux/4.15.0-52-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 555a0731f8818ad83582f978d24ae64751d7ed47aabf57fd75d48fc608d74821 |
|
MD5 | 4e174f3be83bacd05e9e3c22e8fa37c0 |
|
BLAKE2b-256 | 2411e7556f9dfe69e128036e3aa4c67be77b9b4375905ee495f1c18fa4f406f4 |