Conan: Default User and Channel not working

Created on 4 Jun 2019  路  3Comments  路  Source: conan-io/conan

To help us debug your issue please explain:
Conan Version : 1.15.2
OS: Ubuntu 18

Am attempting to set a default user and channel in conanfile.py but they do not seem to take when running both a conan install . or a conan create . Documentation here: https://docs.conan.io/en/latest/reference/conanfile/attributes.html#default-user-default-channel

The install resolves to none/none regardless of whether the property is specified via:
default_channel = "local" default_user = "potato"
or
@property def default_channel(self): return "mydefauluser" @property def default_user(self): return "mydefauluser"

I have tried adding debug logging and invalid syntax to the property func but they do not appear to be called on install or create.

  • [x] I've read the CONTRIBUTING guide.
  • [x] I've specified the Conan version, operating system version and any tool that can be relevant.
  • [x] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
triaging

Most helpful comment

We have a feature in mind related to that, a default user and channel, and being able to avoid them (both when printing references and when inputting references). So you could so something like conan install lib/1.0

All 3 comments

The docs mention For package recipes **working in the user space, with local methods** like conan install . and conan build ., there is no current user/channel. That excludes conan install and conan create

@lasote Could have configuration to set up a default user/channel instead of forcing to pass a reference every time to export-pkg or create?

Seems like it'd be useful. Maybe through an ENV variable or something within the conan config?

For example: make the default $USER/local for local developer builds
Where as CI server would always pass a user/channel for official builds.

We have a feature in mind related to that, a default user and channel, and being able to avoid them (both when printing references and when inputting references). So you could so something like conan install lib/1.0

Was this page helpful?
0 / 5 - 0 ratings