question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] conan download fetches python_requires

See original GitHub issue

Hi everybody,

I’ve noticed some issues with conan download in our CI pipeline. A short summary of the pipline with pkgA depends on pkgB:

  • the CI is building pkgB because of some code changes. It is uploading the pkg to a temp repo on artifactory, e.g. conan-libs-temp.
  • the CI is automatically triggering the build of pkgA to test build against pkgB and tries to fetch the recipe of pkgB from the temp repo to create the build order:

conan download pkgB/some_ver@some_org/snapshot#2ea7ed78fe8fb6c7a40451abd0db25c7 -r conan-libs-temp --recipe conan graph lock pkgA/some_ver@some_org/stable -pr [...] --remote rmc-conan-libs --build missing

However, conan download fails if pkgB uses python_requires:

ERROR: Error loading conanfile at '[...]/conanfile.py': python_pkg/some_ver@some_org/stable was not found in remote 'conan-libs-temp'

The python_pkg is not available in ‘conan-libs-temp’ because it was not build. The docs state that “requirements of the specified reference will NOT be retrieved”, but this seems not true for python_requires.

What I would expect from the docs is, that conan download only fetches the recipe of pkgB and a subseqent call to conan [graph] lock on pkgA then fetches the python_pkg from a the same remote then pkgA. We are still using conan 1.22, but I don’t think it’s related as the docs didn’t change.

Therefore, my questions are:

  • is this behaviour of conan download expected?

  • if yes: how would then one handle this case in the CI pipeline?

  • I’ve read the CONTRIBUTING guide.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Jun 23, 2021

I’ve created a POC using lockfiles for dependency upload including python_requires. The pipeline now succeeds. Thanks for the feedback!

Happy that it is working!

We will use this feedback, and make the python_requires more easily available in graph information in Conan 2.0. Thanks!

1reaction
Da-LiFecommented, Jun 23, 2021

but it seems that python_requires are not covered by this file, at least in conan 1.22. Is that observation correct? If yes, we would need to gather that information from the lockfile generated during conan [graph] lock, right?

Yes, it seems that python_requires are not there, and it would be difficult to add them, because the infrastructure for that feature doesn’t have access to that. I guess you are right, and gathering them from the lockfile could be the best approach.

I’ve created a POC using lockfiles for dependency upload including python_requires. The pipeline now succeeds. Thanks for the feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[question] How to merge python_requires similar to recipe ...
I am trying to access class(es) defined via python_requires from within the same class where it is defined in. The Conan docs state...
Read more >
Python requires — conan 1.46.2 documentation
The python_requires feature is a very convenient way to share files and code between ... from conans import ConanFile class Pkg(ConanFile): python_requires ......
Read more >
Conan Package Manager for C++ in Practice - YouTube
By Jerry Wiltse, presented at Core C++ [online] meetup, March 2021. The slides can be found at http://bit.ly/ConanDemo, more links to Conan ......
Read more >
Do not install dependencies on conan install - Stack Overflow
Is there a way to not install dependencies of a conan package, on using the ... Conan Download is the command what you...
Read more >
Issue navigator - Jira - JFrog
* *What problem are you trying to solve?* When deploying a PyPi package to any location that is not the repository root (e.g:[http://localhsot: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found