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

test: always use the same exact python executable regardless of $PATH #547

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

wookayin
Copy link
Member

@wookayin wookayin commented Oct 18, 2023

Problem:
The embedded neovim fixture instance for testing picks up python3
on the $PATH. This can be different from the current python.

(Example)

$ which python3
/usr/local/bin/python3
$ which python3.11
$HOME/.pyenvs/versions/3.11.5/bin/python3.11

$ python3.11 -m pytest

then neovim will have /usr/local/bin/python3 as the python3 host,
so the behavior of :python (and pynvim especially when it has local
changes during development) can be different.

Solution:
The embedded nvim instance should always pin g:python3_host_prog to
sys.executable.

@wookayin wookayin changed the title fix: always use the exact same python executable regardless of $PATH fix: always use the same exact python executable regardless of $PATH Oct 18, 2023
@wookayin wookayin force-pushed the fix-test-path branch 2 times, most recently from 51a6668 to 9fdc7a0 Compare October 18, 2023 07:30
Problem:
The embedded neovim fixture instance for testing picks up `python3`
on the `$PATH`. This can be different from the current python.

(Example)

    $ which python3
    /usr/local/bin/python3
    $ which python3.11
    $HOME/.pyenvs/versions/3.11.5/bin/python3.11

    $ python3.11 -m pytest

then neovim will have `/usr/local/bin/python3` as the python3 host
(however should be `python3.11`), so the behavior of `:python` and
the `pynvim` module especially when it has local changes during
development) can be different.

Solution:
The embedded nvim instance should always pin `g:python3_host_prog` to
`sys.executable`.
@wookayin wookayin changed the title fix: always use the same exact python executable regardless of $PATH test: always use the same exact python executable regardless of $PATH Oct 19, 2023
@justinmk justinmk merged commit 86cc50e into neovim:master Nov 13, 2023
19 checks passed
@wookayin wookayin deleted the fix-test-path branch November 13, 2023 19:55
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.

2 participants