Comments (5)
I think is issue was solved with teh python_requires feature, which is a dedicated feature for this purpose.
https://docs.conan.io/en/latest/extending/python_requires.html
Feel free to comment or reopen in case you disagree. Thanks!
from docs.
Hi @dkgs You can fork this repo and make a PR.
You can build locally installing sphinx (pip install sphinx) and other require I can't remember sphinx-???
Then you can run make html and browse the _build folder.
But don't care if you cannot run the build, just make a PR to develop branch and we will fix any "style" thing we see.
Thanks!
from docs.
@lasote I think there is a misunderstanding and I apologize for it. When I said
If someone could quickly show me how to do it
I was talking on how to do the conan file template to inherit, not the documentation itself.
There will be no problem in writing the doc (as I already forked this repo :))
from docs.
A few tips:
-
There are two common approaches to create base or common recipes for many packages. One would be to generate the conanfile.py recipes from templates, with any string templating mechanism (the simplest would be a string search & replace for strings like %NAME% or %VERSION%, but other better alternatives as jinja can be used). The other one would be extending (inheriting) the python ConanFile recipe class.
-
The string template is very simple, just save in a ```conanfile.py.in`` the contents of the recipe, then have a master script that orchestrates the package creation just use it and replace the desired fields for each recipe
-
The extending one: Just put common code in an "abstract" base class:
from conans import ConanFile
class ConanBase(ConanFile):
# common code here
Then have other classes (the actual recipes):
from . import ConanBase # Use real import here
class ConanPkgLib(ConanBase):
name = "Pkg"
version = "0.2"
The only trick is that the base class should be also added to the recipe, so the exports="*.py"
field might be necessary.
from docs.
I like the idea of extending the base class, because even if common functionalities are used, the packages can differs in some specific points.
But what bothers me is that the base class should be added to the recipe. Does it means that if I have N packages sharing common functionalities, I have to copy the base class in each of them ? If so, isn't it possible to separate this base class and put it in another recipe and then the N-packages can add it to their requirements ?
This would be ideal, because the base class would be treated as a dependency, have a version and so on... but I can already see the problem : how to import this base class that is defined in the requirements and therefore should have already be imported...
So now we are stuck and should copy the base class in each package where we need it ? Otherwise, I didn't understand something.
from docs.
Related Issues (20)
- [question] VirtualBuildEnv in packages that were not just built HOT 9
- [bug][docs] `generic_system` documentation is wrong/`compilers` block is not documented HOT 2
- [bug][docs] Missing information about removal of `-e`, `-e:b` and `-e:h` and what to use instead HOT 3
- [question] Issue with `extra_cxxflags` not initializing `CMAKE_CXX_FLAGS_INIT` in Ninja Multi-Config CMake projects since Conan 2.1.0 HOT 6
- [bug] the “exported” files are not copied to the self.source_folder before calling the source() method HOT 3
- [question] [conan2] [config] How do I specify a path containing "~" in global.conf? HOT 5
- Make cpp_info transitive information more clear when using components
- [missing doc] Undocumented side-effect and parameter `auto_generate` HOT 1
- remotes.json docs missing allowed_packages HOT 1
- [bug] core.net.http:proxies format is unclear HOT 1
- [feature] Can revision calculation for SCM mode be changed to allow the user to identify URL pattern? HOT 5
- Bad custom command example in docs HOT 3
- `self.conf_info.define_path` not documented but used in examples
- Document Version properties
- failed to generate epub file on release/2.3 branch HOT 1
- Improve how to use CMake and Ninja as generator
- [question] How to set options with hyphens in conanfile.py? HOT 5
- Documentation for CONAN_RUNTIME_LIB_DIRS seems incorrect
- Tutorial suggests that configuration will be set in the toolchain file, but it appears not to be HOT 4
- WITH_FMT not apparent anywhere in the project - tutorial creating_packages/preparing_the_build HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.