Skip to content

Conversation

@Groveer
Copy link
Contributor

@Groveer Groveer commented May 15, 2023

No description provided.

Copy link
Collaborator

@Jint-lzxy Jint-lzxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not very supportive of making this change b/c we ought to use the pre-compiled executables for host_progs due to the -m <mod> flag (usually -m pip <arguments> is used for installing dependencies, and users who have installed many versions of Python(3) will encounter environment issues)

-m mod : run library module as a script (terminates option list)

@Groveer
Copy link
Contributor Author

Groveer commented May 15, 2023

But using this change solves the problem of adaptation to different platforms. You cannot assume that the command exists in the specified directory, especially for the Windows platform.

@Groveer
Copy link
Contributor Author

Groveer commented May 15, 2023

It should be up to the user to ensure that the environment variables are correct, rather than specifying a path that cannot be changed.

@Groveer Groveer requested a review from Jint-lzxy May 15, 2023 13:57
@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented May 15, 2023

IMO issuing errors early (executable not found) is way more intuitive (and debuggable) than getting ModuleNotFoundError: No module named '<random-package-name>'. b/c there're many users who don't use Python (or are new to nvim) but still need python_host_prog support. FWIW simply changing the file path is easier than debugging an unfamiliar language.

Say if a user gets ExecutableNotFoundError first and then ModuleNotFoundError again, then things are very clear - that specific Python distribution used doesn't have corresponding dependencies installed.

@Groveer
Copy link
Contributor Author

Groveer commented May 15, 2023

I don't have any doubts, but I still think that it would be better to use environment variables, one is more general, it can be cross-platform, and the other is that users should be responsible for their own environment variables, after all, setting environment variables is a basic operation for developers.

@Jint-lzxy
Copy link
Collaborator

I don't have any doubts, but I still think that it would be better to use environment variables, one is more general, it can be cross-platform, and the other is that users should be responsible for their own environment variables, after all, setting environment variables is a basic operation for developers.

Agree with you on this. We shall wait for other reviewers to check this PR, and if most of us are happy with this idea, we can also make more changes and remove several unnecessary conditionals 👍

@ayamir
Copy link
Owner

ayamir commented May 16, 2023

For versatility, just use executable name is better because we provides cross-platform experience in fact. Approve these changes.

@Jint-lzxy Jint-lzxy changed the title fix: use commands in environment variables instead of absolute paths feat!: use executables on $PATH May 16, 2023
Copy link
Collaborator

@Jint-lzxy Jint-lzxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ayamir ayamir merged commit 1b53c90 into ayamir:main May 16, 2023
leavers pushed a commit to leavers/nvimdots that referenced this pull request May 16, 2023
* fix: use commands in environment variables instead of absolute paths

* fixup! fix: use commands in environment variables instead of absolute paths

---------

Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this pull request May 16, 2023
* fix: use commands in environment variables instead of absolute paths

* fixup! fix: use commands in environment variables instead of absolute paths

---------

Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
@charliie-dev
Copy link
Collaborator

side note: i hard coded the path just to get a faster startup time.

bleedingfight pushed a commit to bleedingfight/nvimdots that referenced this pull request Jun 22, 2023
* fix: use commands in environment variables instead of absolute paths

* fixup! fix: use commands in environment variables instead of absolute paths

---------

Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
@Jint-lzxy Jint-lzxy mentioned this pull request Jul 24, 2023
2 tasks
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