You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We started an experimental migration of our packages to conan 2.x.
Our packages use python_requires to declare a base dependency for our conanfiles which works fine with conan 1.x but has changed behaviour with conan 2.x
In our consumer conanfiles we use the following:
class MyPackageConan(ConanFile):
name = "mypackage"
version = "0.0.1"
python_requires = "conan_file_base/2023.01"
python_requires_extend = "conan_file_base.MyConanFileBase"
...
We then package the packages with conan export-pkg:
In case conan_file_base is not yet in the local cache, but available on the remote repository myremote export-pkg with conan 2.x seems to fail even though the remote is defined on the command line with -r myremote:
...
conan_file_base/2023.01: Not found in local cache, looking in remotes...
ERROR: Error loading conanfile at '.../mypackage/conanfile.py': Cannot resolve python_requires 'conan_file_base/2023.01': No remote defined
...
Explicitly downloading the python_requires dependency before export-pkg solves the issue: conan download conan_file_base/2023.01 -r myremote
Question
Is this an intended behavior change to enforce conan downloads for python_requires compared to conan 1.x?
The errror message "No remote defined" even though a remote is defined on the command line seems to suggest that this is a bug.
conan --version
Conan version 2.0.2
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
Thanks for reporting.
There was some recent fix in 2.0.2 to add the --remotes flag to export-pkg, but it could be that it is not correctly applying to python_requires. Let me have a look.
What is your question?
Hi,
We started an experimental migration of our packages to conan 2.x.
Our packages use python_requires to declare a base dependency for our conanfiles which works fine with conan 1.x but has changed behaviour with conan 2.x
In our consumer conanfiles we use the following:
We then package the packages with conan export-pkg:
conan export-pkg -r myremote mypackage/conanfile.py
In case conan_file_base is not yet in the local cache, but available on the remote repository myremote export-pkg with conan 2.x seems to fail even though the remote is defined on the command line with -r myremote:
Explicitly downloading the python_requires dependency before export-pkg solves the issue:
conan download conan_file_base/2023.01 -r myremote
Question
The errror message "No remote defined" even though a remote is defined on the command line seems to suggest that this is a bug.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: