Get only package name and version via conan info
See original GitHub issueHi,
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:
- Created 7 years ago
- Comments:8 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For reference, now there exist the
conan inspect .
command that allows easier retrieval of package name, version and other attributes.I am in groovy, so still a one liner:
The --only features is not really well documented. for now, @worksforme @closed. 😃