-
Notifications
You must be signed in to change notification settings - Fork 988
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
Update powershell conf to select from powershell and pwsh #17416
Conversation
Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this ticket in #17434, that the user was affected by their powershell profile changing the cwd. This could be avoided by -noProfile
, but as @Todiq points out in #17434 (comment), this might break users that rely on this.
We could add yet another conf, or maybe allow users to do tools.env.virtualenv:powershell="powershell -noProfile"
or any other arguments they might want to provide?
I can think of two alternatives:
or
What do you think? @memsharded @AbrilRBS |
I'd probably go for the 1 configuration if we still support the basic string simple case, good for vast majority of users: |
Let's try with the simpler version of using a string like |
I agree - we just might want to make sure the docs mention that you're only ever supposed to use powershell.exe/pwsh.exe |
conan/tools/env/environment.py
Outdated
powershell = "powershell.exe" if conanfile.conf.get( | ||
"tools.env.virtualenv:powershell") is True else conanfile.conf.get("tools.env.virtualenv:powershell") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to check if this is True to provide compatibility with the deprecated syntax.
The problem is that conanfile.conf.get("tools.env.virtualenv:powershell", check_type=str)
does not work because it will evaluate True
or False
as strings and not raise any exceptions.
Changelog: Feature: Updated
tools.env.virtualenv:powershell
conf to allow specifying the PowerShell executable (e.g., powershell.exe or pwsh) and passing additional arguments.Changelog: Feature: Deprecate use of
tools.env.virtualenv:powershell=True/False
.Docs: conan-io/docs#3947
This will change how our powershell scripts are executed from:
to
Depending if we select to use
pwsh
(version 7) orpowershell.exe
Not exactly meant to close this: #17339 but related to that.