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

'asdf current --as-tool-versions' outputs a format suitable for export to .tool-versions #1058

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

teruokun
Copy link

Summary

Add in an option for asdf current that outputs a format compatible to use as a .tool-versions file. This is useful for replicating a local configuration across one or more configuration files to be used by another host/environment and also outputs more controlled formats for other tools that may want to query what is currently active.

…ol-versions specification based on current setup
@teruokun teruokun requested a review from a team as a code owner September 27, 2021 19:24
@jthegedus
Copy link
Contributor

jthegedus commented Nov 2, 2021

I think this type of change warrants a larger discussion before a PR. I can think of reasons not to do this.

@Stratus3D
Copy link
Member

Thanks for the PR @teruokun, I do think we need to discuss this before preparing to merge. If you have any relevant issues/discussions related to this can you please link to them? Thanks!

@offbyone
Copy link
Contributor

offbyone commented Nov 3, 2021

I know for my part, I want the ability to test out tool version setups in a subshell and then persist them to a project configuration. Sort of a "lock" approach to the process.

@teruokun
Copy link
Author

teruokun commented Nov 3, 2021

So, the main reasoning is to allow for easy duplication of the asdf current environment used locally on another host. As it may be composed of multiple layers, tracking through all of the named configurations and merging them seems like a lot of repeated logic when what we care about is how asdf specifically will interpret the configuration. This also allows for programmatic reading of the configuration in a more-controlled format as there is no consistent delineation of the standard text output when multiple versions are surfaced (for example, python 3.9.7 3.8.10 3.10.0) to allow for a named default (e.g. python) that can be used side-by-side with version-specific binaries (e.g. python3.10).

So in other words, I want to avoid weird behavior around parsing this output when all I intend for is to use it with another asdf installation

@Stratus3D
Copy link
Member

Overall these changes look good to me, and I think this is a nice addition. @jthegedus what do you think?

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

Successfully merging this pull request may close these issues.

4 participants