-
Notifications
You must be signed in to change notification settings - Fork 340
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
Enhancements for shell plugins #698
Enhancements for shell plugins #698
Conversation
Thanks for the review. I'll dropped notes/questions and will look into the fixes. |
I've updated the first post and addressed everything in your review. Ran the tests again, pass as before. |
e626781
to
89acad7
Compare
FYI, zsh tests on master should be fixed when #711 is merged in. |
I'm ready to merge this, but would like to hear RE OSX testing also. In the meantime I'm going to start looking at GitHub Actions, so we'll have this testing covered anyway (and across py2/3 also, which is going to become important pretty soon). |
Cool will try merging this in. Thanks! |
|
7bff0cf
to
d55b4f4
Compare
…all shell tests. This implements ${VAR} and $VAR variables for cmd and Powershell like, as well as their native forms like %VAR% and $Env:VAR. In order to handle the ambiguity of variables in the form of $Env:Literal in Unix and Windows the NamespaceFormatter may take interpreter regex into account that is being supplied by the underlying shell. For command execution on Windows .PY is being added to the PATHEXT and the create_script function is extended to create any form of execution script. This behaviour can be controlled via a rezconfig, but defaults to backwards compatible Unix-only behaviour.
This introduced quotation issues as detailed in AcademySoftwareFoundation#691 This reverts commit e513b69. # Conflicts: # src/rezplugins/shell/cmd.py
It should be noted that according to [1] this is not an officially exposed API, but in order to avoid License clearance for now I just used it similar like we use pipes.quote in `shells.py`. [1] https://bugs.python.org/issue10838
Line termination is not necessarirly platform dependent, but also shell dependent.
Shells which do not use the generic ${VAR} or $VAR form should use convert_token to convert to their native form. This only assumes that a shell correctly extends ENV_VAR_REGEX to also parse their own variables.
Also fixes spelling of attribute to conform to PowerShell style.
d55b4f4
to
e2f4242
Compare
Notable changes since your last review:
So now it is just a question if we want #707 first. All tests (except cmake related) pass on Win & Linux. |
Thanks Blazej. I'm happy to merge this and will do soon - it stands on its own from #707 and fixes an outstanding bug on Windows. |
Just an update - getting to this soon. We're near the end of the py3 work, I'm hoping to get that done first then merge this right after. |
No worries, there is no rush with this merge. I would love to hear your feedback on #737 though since this is the last missing piece for our Rez deployment. Btw. I haven't tested this PR with python 3, so let me know if there is any work to be done. |
Yeah I'm pretty slammed atm but I'm keen to get onto both #737 and #703 so
I'll do that soon.
We're maybe a few days/a week away from wrapping up on py3 port, so I
reckon if you could do some testing on it once that's done, that would be
very helpful.
Cheers
A
…On Wed, Sep 11, 2019 at 11:03 AM Blazej Floch ***@***.***> wrote:
No worries, there is no rush with this merge. I would love to hear your
feedback on #737 <#737> though
since this is the last missing piece for our Rez deployment.
Btw. I haven't tested this PR with python 3, so let me know if there is
any work to be done.
In fact, we as a Blender-based animation studio would love to run rez with
python 3 so I might be running tests based on your effort soon.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#698>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMOUSQHJLGVHIA4USJAXMTQJA7VBANCNFSM4IPRPMLQ>
.
|
This fixes and improves the shell plugins, especially on Windows for cmd and PowerShell-like.
Formally excluded shell dependent tests are now passing.
I would love to have someone run the test-suite on MacOS.
Future work
get_syspaths
under LinuxFixes
$ENVVAR / ${ENVVAR}
as well as shell specific ones correctly, like%ENVVAR% ${Env:ENVVAR}
for cmd and PowerShell-like shellsFeatures / Enhancements
Added
get_all_key_tokens
to allow for multiple key-formsAdded
convert_tokens
to normalize token forms to shell specific formAllow pwsh shell on Linux (and pass tests)
Implements optional script execution on windows via PATHEXT.
create_executable_script
now returns list of created scripts based onconfig.create_executable_script_mode
:single
(default) Just create the requested script. Usually extension-less.py
create .py script that will allow launching scripts on windows,platform_specific
will create .py script on windows and requested on other platformsboth
creates the requested file and a .py script for windowsIntroduced Shell specific regex parsing to handle ambiguous case like
set PATH=$ENV:VAR
in PowerShell vs. Bash within the NamespaceFormatterIntroduced printout of shell name for
shell_dependent
test failureTests passing
test_build_cmake
like in master. Will be addressed next.fails like on masterPasses based on zsh tests passing by way of enabling analogue for bash shell completion #711Backwards compatibility
get_all_key_tokens(key)
(with safest/common form at index 0)line_terminator()
for shell/platform specific line_terminator as expected by the shelljoin
now a class methodENV_VAR_REGEX
if needed with shell specific token formsconvert_tokens
in you implementation ofinfo
anderror