asdf-python icon indicating copy to clipboard operation
asdf-python copied to clipboard

asdf poetry gets confused after a python update

Open mcarifio opened this issue 3 years ago • 3 comments

I installed python 3.9.0 and poetry with asdf, then installed python 3.9.2 and made it the default in ~/.tool-versions. Poetry was confused. I looked at the shim /opt/asdf/current/shims/poetry:

#!/usr/bin/env bash
# asdf-plugin: python 3.9.0
exec /opt/asdf/current/bin/asdf exec "poetry" "$@"

which I changed to 3.9.2 and added poetry 1.1.6 to ~/.tool-versions. Then it works.

I suspect you have no control over the code in the shim. It looks generated. But if you do, it would be useful:

  • to know if the script is generated and if so how to update it
  • use ASDF_DIR in the exec line: exec ${ASDF_DIR:-/opt/asdf/current}/bin/asdf exec "poetry" "$@"

This is probably related to https://github.com/asdf-vm/asdf/issues/859.

I'm not sure this is an "issue" so much as an inconvenience. But I had to wander around a bit to figure out how to make the pieces work together. Which is umm suboptimal.

mcarifio avatar May 04 '21 14:05 mcarifio

Where are my manners? Ty for creating asdf-poetry. Installing it directly isn't heavy lifting (and in fact it would avoid the glitch above). But as asdf matures, it will carry along a whole bunch of tools (I hope).

mcarifio avatar May 04 '21 14:05 mcarifio

@mcarifio, does asdf reshim solve your problem?

Sure looks like you got your wish!

Kurt-von-Laven avatar Oct 28 '21 09:10 Kurt-von-Laven

Yes. Funny, I just learned about reshim wrt python last week. Ty.

mcarifio avatar Oct 28 '21 13:10 mcarifio