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

Remove fish --init-command, fixes #9463 #9464

Closed
wants to merge 1 commit into from

Conversation

phette23
Copy link

@phette23 phette23 commented Jun 1, 2024

Don't use --init-command when starting a fish venv subshell, instead treat it as other shells. The --init--command doesn't work well with python managed by mise. This has an added bonus of removing a few lines of code and some special handling for fish that doesn't seem to be necessary.

Pull Request Check List

Resolves: python-poetry/poetry-plugin-shell#7

I'm not sure where the tests are for Shell but I'm happy to look at writing some for this. It's tricky because the bug being addressed is only for a specific environment (mise and fish shell). What I did to confirm was:

> poetry install # make a venv
> poetry shell
> which -a python
/path/to/global/mise/python
/path/to/venv/python
> # apply patch
> poetry shell
> which -a python
/path/to/venv/python
/path/to/global/mise/python

Hopefully the issue and testing its solution is clear from the issue I submitted.

Don't use --init-command when starting a fish venv subshell, instead treat it as other shells. The --init--command doesn't work well with python managed by mise.

Ref: python-poetry/poetry#9463
@dimbleby
Copy link
Contributor

dimbleby commented Jun 1, 2024

#8804

@phette23
Copy link
Author

phette23 commented Jun 1, 2024

Yeah this basically reverts #8804 😔 it is nice to not have the extra source line as described in that PR but poetry shell isn't working for me with --init-command.

@radoering
Copy link
Member

@MrGreenTea Maybe, you have an opinion/idea since you contributed #8804.

@MrGreenTea
Copy link
Contributor

@radoering thanks for notifying me.

I'd love to take a look at this. To me it seems this is more a weird behaviour by mise than an issue with poetry. Reversing this feature seems a workaround for that problem which I would love to take a look next week if it's not too urgent :)

@Secrus Secrus added the area/shell Related to `poetry shell` label Oct 1, 2024
@Secrus
Copy link
Member

Secrus commented Oct 28, 2024

Further development of the shell command was moved to poetry-plugin-shell, please open PR in that repo.

@Secrus Secrus closed this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/shell Related to `poetry shell`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

poetry shell doesn't work with mise and fish shell, venv python is behind mise in path
5 participants