Skip to content
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

fix python-requires in remote for export-pkg #13496

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion conan/cli/commands/export_pkg.py
Expand Up @@ -49,7 +49,8 @@ def export_pkg(conan_api, parser, *args):
remotes = conan_api.remotes.list(args.remote) if not args.no_remote else []

ref, conanfile = conan_api.export.export(path=path, name=args.name, version=args.version,
user=args.user, channel=args.channel, lockfile=lockfile)
user=args.user, channel=args.channel, lockfile=lockfile,
remotes=remotes)
# The package_type is not fully processed at export
assert conanfile.package_type != "python-require", "A python-require cannot be export-pkg"
lockfile = conan_api.lockfile.update_lockfile_export(lockfile, conanfile, ref,
Expand Down
14 changes: 14 additions & 0 deletions conans/test/integration/command/export_pkg_test.py
Expand Up @@ -594,3 +594,17 @@ def test(self):
assert "RUN TEST PACKAGE!!!!" in c.out
lock = json.loads(c.load("conan.lock"))
assert "pkg/1.0" in lock["build_requires"][0]


def test_export_pkg_remote_python_requires():
""" Test that remote python-requires can be resolved
"""
c = TestClient(default_server_user=True)
c.save({"tool/conanfile.py": GenConanfile("tool", "1.0"),
"pkg/conanfile.py": GenConanfile("pkg", "1.0").with_python_requires("tool/1.0")})

c.run("create tool")
c.run("upload tool* -r=default -c")
c.run("remove * -c")
c.run("export-pkg pkg")
assert "conanfile.py (pkg/1.0): Exported package binary" in c.out