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.

Get only package name and version via conan info

See original GitHub issue

Hi,

To upload only the package that is currently build on our CI Server, I would need to get the name and version from the conanfile. As the version number is created from a fixed version and a build number (from environment variables), i can’t grep them out of the file.

The conanfile looks something like this:

from conans import ConanFile, CMake, os
build_name = "-build" + os.getenv("BUILD_ID", "-local")

class MyConan(ConanFile):
    name = "MyPackage"
    version_number = "0.1.1-alpha"
    settings = "os", "compiler", "build_type", "arch"
    short_paths=True
    version = version_number + build_name
...

I would like something like conan info --name resulting in MyPackage/0.1.1-alpha-build12345

Is there already a way to do this?

Best, Claas

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
memshardedcommented, Jan 11, 2019

For reference, now there exist the conan inspect . command that allows easier retrieval of package name, version and other attributes.

2reactions
claasdcommented, Jan 26, 2017

I am in groovy, so still a one liner:

text.find('(\\S+)@PROJECT') { match, name -> return name; };

The --only features is not really well documented. for now, @worksforme @closed. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to dynamically define the name and version of a package
You can extract the version dynamically using: from conans import ConanFile from conans.tools import load import re, os class HelloConan(ConanFile): name ...
Read more >
CONAN CHEAT SHEET - JFrog
Conan application configuration. $ conan config get ... conan user -p <password> -r my_remote <username> ... Install package using just a reference. $...
Read more >
Index · Conan repository · Packages · User · Help · GitLab
Build a package · Open a terminal and navigate to your project's root folder. · Generate a new recipe by running conan new...
Read more >
Conan repository · Packages · User · Help · GitLab - ETSI Forge
Build a package · Open a terminal and navigate to your project's root folder. · Generate a new recipe by running conan new...
Read more >
Index · Conan repository · Packages - Help · GitLab - ITIAM
Standard Conan recipe convention looks like package_name/version@username/channel . Recipe usernames must be the + separated project path. The package name may ...
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