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

adds fallback behavior for non-ms shells #6560

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

bmarroquin
Copy link
Contributor

Pull Request Check List

Resolves: #6495

  • Added tests for changed code.

Confirmed working on MS Powershell, Powershell 7, cmd and git bash

@neersighted neersighted added kind/bug Something isn't working as expected area/windows For Windows-specific issues status/2-code-review area/shell Related to `poetry shell` labels Sep 19, 2022
@neersighted neersighted added this to the 1.3 milestone Sep 19, 2022
@neersighted neersighted added impact/backport Requires backport to stable branch impact/changelog Requires a changelog entry backport/1.2 labels Sep 19, 2022
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple thoughts -- args should be hoisted instead of being part of an else branch.

However, I'm wondering about this whole approach. Doesn't pexpect work on Windows? Why not use the same code path we use on Unix OSes as much as possible, and keep the special-casing to Windows Powershell and cmd.exe?

@bmarroquin
Copy link
Contributor Author

I'll give it a shot

@bmarroquin
Copy link
Contributor Author

pexpect's windows support is missing the interact method. Without that, you can't run a sub shell or reuse any of the unix code path. I tried a few things but none of them worked.

Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- this class is heavily overloaded and needs to be refactored, but this was a regression in 1.2 and we shouldn't let the refactor block the fix.

@neersighted neersighted enabled auto-merge (rebase) October 7, 2022 19:11
@neersighted neersighted merged commit 3d422d7 into python-poetry:master Oct 7, 2022
@poetry-bot
Copy link

poetry-bot bot commented Oct 7, 2022

The backport to 1.2 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport-6560-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3d422d72159418ca23105fb6ea38f86af62af23f
# Push it to GitHub
git push --set-upstream origin backport-6560-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2

Then, create a pull request where the base branch is 1.2 and the compare/head branch is backport-6560-to-1.2.

@bmarroquin bmarroquin deleted the fix-bash-shell-windows branch March 11, 2023 15:37
Copy link

github-actions bot commented Mar 3, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/shell Related to `poetry shell` area/windows For Windows-specific issues impact/backport Requires backport to stable branch impact/changelog Requires a changelog entry kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

poetry shell in git bash on Windows broken since 1.2.0
2 participants