asdf-community / asdf-community/asdf-python

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

Aperta
#206 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Shell
Stelle
729
Fork
65
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Riproduci il percorso: configura con `asdf local python path:/netops/local/python-3.9.2`, quindi confronta `asdf which python` e `asdf which python3` e le relative versioni. Traccia gli entry point degli shim `python` e `python3` per le versioni basate sul percorso; è completato quando entrambi gli shim invocano l’installazione Python configurata invece del `python` di sistema.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, shell
Ambito
cli, tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.