asdf-community / asdf-community/asdf-python

With `path:` version, `python` shim fails (but `python3` works) (asdf v0.13)

Open
#206 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
729
Forks
65
PR merge metrics
No merged PRs in 30d

Description

### Provide environment information

```bash
OS:
Linux ad-user-ads-11.s.xx.xxx 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.37(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/usr/lusers/jacktose/.asdf
ASDF_DIR=/usr/lusers/jacktose/.asdf
ASDF_CONFIG_FILE=/usr/lusers/jacktose/.asdfrc

ASDF INSTALLED PLUGINS:
python https://github.com/danhper/asdf-python.git master 5e277e2
```

### To Reproduce

1. Have a non-asdf python installation:
```
$ /netops/local/python-3.9.2/bin/python3.9 -V
Python 3.9.2
```
1. Configure asdf to use it, [with `path:` syntax][doc]:
```
$ asdf local python path:/netops/local/python-3.9.2
$ cat .tool-versions
python path:/netops/local/python-3.9.2
```
1. Check which `python` is used:
```
$ asdf which python
/usr/local/bin/python
$ python -V
Python 2.7.5
```
1. Compare to `python3`:
```
$ asdf which python3
/netops/local/python-3.9.2/bin/python3
$ python3 -V
Python 3.9.2
```

Note that shims are fine:
```
$ which python
~/.asdf/shims/python
$ which python3
~/.asdf/shims/python3
```

And `python` works as expected for asdf-installed python:
```
$ asdf local python 3.9.15

$ cat .tool-versions
python 3.9.15

$ asdf which python
/usr/lusers/jacktose/.asdf/installs/python/3.9.15/bin/python

$ python -V
Python 3.9.15

$ asdf which python3
/usr/lusers/jacktose/.asdf/installs/python/3.9.15/bin/python3

$ python3 -V
Python 3.9.15
```

### Describe the Bug

When setting the python version to a non-asdf python3 [with a `path:` entry][doc], the `python` shim calls the system python instead of the configured one. The `python3` shim calls the configured one as expected.

[doc]: https://asdf-vm.com/manage/configuration.html#:~:text=path%3A~%2Fsrc%2Felixir

### Expected Behaviour

The `python` shim should call the configured python binary, as the `python3` shim does.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.