I am setting up a project using multiple libraries and packages in C/C++ and Python.
I would like to setup a binary repository for C/C++ packages and a python package index server for python packages.
I stumbled upon conan and artefactory to handle inter C/C++ libraries dependencies but I can't find a clear solution to add standard python package dependencies.
For instance, my project 'A' (C/C++) depends on 'B' (C/C++) that contains code generated using 'C' tool (Python).
I would like to set a requirement for 'B' to 'C' as a pip requirement for a specific distribution of my 'C' tool package.
So far, the solutions I see are:
I would like to avoid to add a conan package for a python package since python has already a package management system and my packages will be available on a python index server.
I would also avoid to add code to handle python package dependencies.
Does anyone have an idea if this is possible with conan in a simple matter ?
Thank you
Alex
Download Dependencies OnlyUse the pipdeptree utility to gather a list of all dependencies, create a requirements. txt file listing all the dependencies, and then download them with the pip download command. Get the list of dependencies for a package from the setup.py file.
Pip Check Command – Check Python Dependencies After Installation. Because pip doesn't currently address dependency issues on installation, the pip check command option can be used to verify that dependencies have been installed properly in your project. For example: $ pip check No broken requirements found.
The specific steps to add new packages are: Fork the conan-center-index git repository, and then clone it locally. Copy a template from package_templates folder in the recipes/ folder and rename it to the project name (it should be lower-case). Read templates documentation to find more information.
Since a Conan recipe is also a Python script, you could run pip directly from the recipe:
def system_requirements(self):
import pip
if hasattr(pip, "main"):
pip.main(["install", "colorama"])
else:
from pip._internal import main
main(['install', "colorama"])
System requirements is the best place, because is related to a required package that is not a Conan package. If you have some condition to be added based on distro, you can use distro_info too.
Take a look here in the documentation, to get more information about.
Regards!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With