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

Add metadata command #74

Closed
baszalmstra opened this issue Jun 12, 2023 · 3 comments
Closed

Add metadata command #74

baszalmstra opened this issue Jun 12, 2023 · 3 comments

Comments

@baszalmstra
Copy link
Contributor

Add a command to get metadata information from the project in a machine-readable format.

The extractable data should include the following:

  • Package metadata like the version, name, and authors.
  • The dependencies of the project.
  • The locked dependencies of the project.
  • Location of the conda environment

We could either format the data simply as JSON or we could use go templates to make it really customizable (there is a crate for that: https://github.com/fiji-flo/gtmpl-rust). Go templates are used by for instance docker or kubernetes.

Why?

To make it easy for other tools to ingest information about the project. For instance, one might want to extract the version of the project to be able to use in during a build step in CMake. Or one might want to extract the information in a CI stage.

Inspiration

@baszalmstra
Copy link
Contributor Author

Since we have the info command now Im going to close this until we run into additional features we need.

@traversaro
Copy link
Contributor

For instance, one might want to extract the version of the project to be able to use in during a build step in CMake.

I had this problem (to get the version of the pixi package and use it as CMake version) but I could not use pixi as at this point I can't assume users of the library have installed, so I some CMake code to read it directly from pixi.toml : https://github.com/ami-iit/idynfor/blob/d7ab3b80c286f8e76de319c5ef2a794ceb836807/CMakeLists.txt#L21 .
For sure it is not as robust as pixi info, but it has the advantage of not requiring pixi at configuration time.

@wolfv
Copy link
Member

wolfv commented Aug 23, 2023

That's really cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants