Skip to content

[bug] conan workspace create fails if python_requires is not in cache but is on remote #20260

Description

@spectralvoid0

Describe the bug

I am using conan 2.31.2 on linux.

If I have a package in a workspace that has a python_requires referencing a package that is on a remote, but not in the cache, conan workspace create cannot resolve the python_requires and emits a No remote defined error.

If I first run conan workspace install, conan workspace source, or conan workspace build, then it works as those download the python_requires package to the cache.

How to reproduce it

Conanfiles

pyreq/conanfile.py

from conan import ConanFile

class MyBase:
    pass

class PyReq(ConanFile):
    name = "pyreq"
    version = "0.1"
    package_type = "python-require"

pkg/conanfile.py

from conan import ConanFile

class Pkg(ConanFile):
    name = "pkg"
    version = "0.1"
    python_requires = "pyreq/0.1"
    python_requires_extend = "pyreq.MyBase"

Commands

conan create pyreq
conan upload -r myremote pyreq/0.1
conan workspace init
conan workspace add pkg
conan remove -c pyreq/0.1
conan workspace create

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions