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

Add an entry point to start simpleindex, run a command in subprocess, and shutdown #16

Open
uranusjr opened this issue Feb 3, 2023 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@uranusjr
Copy link
Owner

uranusjr commented Feb 3, 2023

See discussion in pypa/pip#11771

@uranusjr uranusjr added enhancement New feature or request good first issue Good for newcomers labels Feb 3, 2023
@zooba
Copy link
Contributor

zooba commented Feb 3, 2023

Couple of important notes for this (as someone who will use it, and may end up implementing it (or mentoring someone throguh it)):

  • the command may not be a Python script/module
  • if it is, it may not be running in the same Python as simpleindex does
  • if the user passes python, that isn't automatically a PATH search like they may expect1
  • at least initially, PIP_INDEX_URL and PIP_TRUSTED_HOST env variables need to be set for the subcommand

Footnotes

  1. Windows tries "adjacent to the current executable" first in this case. But documenting this ought to be sufficient, the workarounds are less reliable and most tools don't do them anyway.

@uranusjr
Copy link
Owner Author

uranusjr commented Feb 3, 2023

Regarding the PATH point doing a shutil.which is probably good idea with behaviour better expected by users.

@zooba
Copy link
Contributor

zooba commented Feb 3, 2023

Regarding the PATH point doing a shutil.which is probably good idea with behaviour better expected by users.

I know that's the temptation, but shutil.which also prefers the CWD, which might be the expected behaviour, but it's not the best behaviour. Documenting (and possibly warning on a command that contains no SEP characters?) is almost certainly best.

@uranusjr
Copy link
Owner Author

uranusjr commented Feb 3, 2023

Yes, documentation would also be needed regardless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants