New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conan Python API Use Without Conan File #6315
Comments
Hi @szegel
First, a word of caution. The python api is not documented nor stable. It might change at any time and break your scripts. Then, you need the Finally, the api is a command line alternative, it is not a low level access to Conan internals. As such, it is not possible to install packages in any random directory, as Conan packages follow some conventions, and they are installed in the Conan cache (by default the userhome/.conan). You can change the cache location with CONAN_USER_HOME env-var, but that will still be a Conan cache with a given layout. What you can do is to use the |
Thanks so much for your help! I got a working solution. Here is the code that lets me install and deploy a specific package (and its dependencies) without a Conanfile from the Python API. I understand that the Python API is unstable, and this can break at any time.
|
Cool! Thanks for following up. We will probably stabilize the python api at some point, after Conan 2.0, but it will take some time. In any case, it is not that it changes that wildly that we will be breaking it at every release, so good luck :) |
Is the API still unstable? |
Yes, everything that is not documented in docs.conan.io, is not stable. Actually everything that is not documented shouldn't be used at all. The python API is the exception, we know there are a bunch users using it so:
|
Same question as my predecessors...Is the Conan 2.0 API meanwhile stable? |
Conan 2.0 API is not documented yet, but it is expected to become stable quickly, but this will be most likely after 2.1. You have quite detailed usage in the commands themselves, that would be a good start point to check the API.
You mean with the API? If you want to ask specific questions about any API behavior, feel free to open new tickets for them. |
Hey All!
I am trying to write a python script using the Conan Python API. I am trying to have conan download a package from the server and install that package in a specified directory without requiring a conanfile.py.
I have this package on my Conan Server:
I have been looking at https://github.com/conan-io/conan/blob/develop/conans/client/conan_api.py, but I have been unable to find any documentation on the Conan Python API.
Currently my script looks like this:
This gives the the following error:
Thanks for the help!
The text was updated successfully, but these errors were encountered: