Skip to content

fix exec - #140

Merged
kirankotari merged 12 commits into
pyenv-win:masterfrom
papercuptech:fix-exec
Apr 26, 2021
Merged

kirankotari merged 12 commits into
pyenv-win:masterfrom
papercuptech:fix-exec

Conversation

@papercuptech

Copy link
Copy Markdown
Contributor

'exec' now handled directly in pyenv.bat
ExecCommand() in pyenv.vbs now uses WScript.Shell.exec()
  rather than creating 'exec.bat'

'exec' now handled directly in pyenv.bat
ExecCommand() in pyenv.vbs now uses WScript.Shell.exec()
  rather than creating 'exec.bat'
@dedale

dedale commented Apr 20, 2021

Copy link
Copy Markdown
Collaborator

I tried to rebase this dev 😅, but according to all the tests I added, this breaks ❌ pyenv shell x.y.z use case, which depends on exec.bat. 😢
Idk yet how to circumvent this problem. ⌛ ❓

@dedale

dedale commented Apr 20, 2021

Copy link
Copy Markdown
Collaborator

I tried to rebase this dev 😅, but according to all the tests I added, this breaks ❌ pyenv shell x.y.z use case, which depends on exec.bat. 😢
Idk yet how to circumvent this problem. ⌛ ❓

@kirankotari I think it also breaks Plugin feature

papercuptech added 4 commits April 21, 2021 01:13
support 'shell' and plugins
'exec' now handled directly in pyenv.bat
ExecCommand() in pyenv.vbs now uses WScript.Shell.exec()
  rather than creating 'exec.bat'
support 'shell' and plugins
@dedale

dedale commented Apr 21, 2021

Copy link
Copy Markdown
Collaborator

Thanks @papercuptech, I think moving code to pyenv-shell.bat is the way to go.
To move on getting rid of exec.bat, I first need to add unit tests for pyenv shell and Plugin feature, then I'll rebase this PR.
I have already identified some impacts in the tests I have added.

@papercuptech

Copy link
Copy Markdown
Contributor Author

I've been working on fixes for the shell command and for plugins.

I did move some logic to pyenv-shell.bat, but in order for the PYENV_VERSION var to be set correctly (and eliminate using exec.bat), vbs has to be avoided.

Regarding plugins, even before my fix they suffer from the same argument mangling problem I originally fixed for exec, which was fixed by avoiding going through any vbs code. I've now fixed this issue for plugins as well. Note, my previous fix did break plugins in a different way, but that regression has also now been fixed

I've also rebased my changes, and I'm now working to run the unit tests.

Will update things in a day or two.

support 'shell' and plugins
remove 'shell', plugin, and '<cmd> --help' code from pyenv.vbs
  as theyre now handled directly in pyenv.bat
@kirankotari

Copy link
Copy Markdown
Member

@papercuptech @dedale let me change the base branch, that might help.

@kirankotari
kirankotari changed the base branch from v1.2.5 to master April 21, 2021 14:08
@papercuptech

Copy link
Copy Markdown
Contributor Author

Most tests passed. The first 2 in test_pyenv and all 4 in test_pyenv_feature_shell failed, but it looks to me like the problems are with the tests rather than what's being tested. My own "manual" testing indicates shell now works, plugins work, no exec.bat anywhere in sight. I attempted to debug tests, but not familiar with pytest and don't have the time atm to learn another test environment. Hopefully @dedale can address.

One "enhancement" is that plugins now run with PATH set just like it is with exec command; i.e. paths to "active" version of python.

ensure paths with spaces handled correctly by wrapping in ""
@dedale

dedale commented Apr 22, 2021 via email •

Copy link
Copy Markdown
Collaborator

@dedale

dedale commented Apr 23, 2021

Copy link
Copy Markdown
Collaborator

Commit to fix tests: dedale@ced501a

@kirankotari

Copy link
Copy Markdown
Member

Commit to fix tests: dedale@ced501a

@dedale are you able to push the changes to this PR?

@dedale

dedale commented Apr 23, 2021

Copy link
Copy Markdown
Collaborator

Commit to fix tests: dedale@ced501a

@dedale are you able to push the changes to this PR?

I have created a PR to @papercuptech 's repo: papercuptech#1

@papercuptech

Copy link
Copy Markdown
Contributor Author

Merged @dedale changes into PR, but tests still failing..

@dedale

dedale commented Apr 24, 2021

Copy link
Copy Markdown
Collaborator

Merged @dedale changes into PR, but tests still failing..

In Travis logs, pyenv.bat is getting -m argument. Did not reproduce on my laptop. I will investigate and use a temp PR to ensure tests pass in Travis.

Comment thread pyenv-win/bin/pyenv.bat
Comment thread pyenv-win/bin/pyenv.bat
ensure some version is active before running 'exec'
reset local vars to support pyenv.bat reentry
special case '.cmd' vs '.bat' plugins
  '.bat' can alter shell vars, but PATH not set to active version
  '.cmd' (and '.vbs') just the opposite
woops.. remove tab indents
Comment thread pyenv-win/bin/pyenv.bat Outdated
Comment thread pyenv-win/bin/pyenv.bat Outdated
remove erroneous 'echo %bindir%'
exit when no active version
@dedale dedale added the enhancement New feature or request label Apr 25, 2021
@kirankotari
kirankotari merged commit 29000db into pyenv-win:master Apr 26, 2021
@papercuptech papercuptech mentioned this pull request Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants