Skip to content

Require “--python” values to exist #1864

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

Merged
merged 3 commits into from
Apr 19, 2018

Conversation

acdha
Copy link
Contributor

@acdha acdha commented Mar 28, 2018

This makes it easier for someone to realize when they have provided an invalid Python path without missing that message due to the sizable virtualenv traceback which follows it. I first encountered this when someone copy-and-pasted the example from the Conda documentation which has --python=/path/to/anaconda/python.

See #1862

@acdha acdha changed the title Require “--python” values to exist WIP: Require “--python” values to exist Mar 28, 2018
@acdha acdha force-pushed the early-python-executable-check branch 2 times, most recently from 76651d5 to a07e0d6 Compare March 28, 2018 14:02
@uranusjr
Copy link
Member

This is still WIP so I might be commenting too early, but aside from absolute path --python also accepts version-like names (e.g. 3.6, 2.7.10). They need to be taken into consideration when validating the argument.

@acdha
Copy link
Contributor Author

acdha commented Mar 28, 2018

@uranusjr Yes — I ended up with a more conservative approach of only validating things which appear to be absolute paths to avoid that. It's worked in limited local testing but I'm still waiting for the test suite to finish running.

@techalchemy
Copy link
Member

hey @acdha when you get a second can you update w/ current master so we can get tests running against this?

@techalchemy
Copy link
Member

p.s sorry for the delay, tests were very broken (also sorry for the enormous pull you are going to have to do)

@techalchemy
Copy link
Member

If you could revisit this at some point it would certainly make a good addition!

This makes it easier for someone to realize when they have provided an
invalid Python path without missing that message due to the sizable
virtualenv traceback which follows it. I first encountered this when
someone copy-and-pasted the example from the Conda documentation which
has `--python=/path/to/anaconda/python`.

See pypa#1862
@acdha acdha force-pushed the early-python-executable-check branch from 98abb5d to e3ee7fb Compare April 18, 2018 19:36
@acdha
Copy link
Contributor Author

acdha commented Apr 18, 2018

Sorry about the delays — I'm on parental leave the moment and don't have too much brainpower left for open-source 😀

I rebased it against master and the tests are passing now on Travis so I removed the WIP prefix

@acdha acdha changed the title WIP: Require “--python” values to exist Require “--python” values to exist Apr 18, 2018
@techalchemy
Copy link
Member

Congrats and thanks a bunch!

P.S. We actually met at a conference at the LoC a long time ago, Back then I was working as the 'Curator of Executable Content' on an archive project, small world!

@techalchemy techalchemy merged commit cc221d1 into pypa:master Apr 19, 2018
@acdha
Copy link
Contributor Author

acdha commented Apr 24, 2018 via email

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.

3 participants