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

Support Ribasim checkout #85

Merged
merged 4 commits into from
May 16, 2024
Merged

Support Ribasim checkout #85

merged 4 commits into from
May 16, 2024

Conversation

visr
Copy link
Member

@visr visr commented Apr 22, 2024

Fixes #84.

This adds a Pixi dev environment, which points to the Ribasim repository, which is expected to be cloned next to this repository. To launch VSCode in this environment, use open-vscode-dev.bat. I added open-vscode.bat as well to open the default environment, which points to the latest ribasim release.

https://pixi.sh/latest/reference/configuration/#the-feature-and-environments-tables

@visr visr marked this pull request as ready for review April 22, 2024 14:21
@visr
Copy link
Member Author

visr commented May 14, 2024

@DanielTollenaar do you have time for a review?

Copy link
Collaborator

@DanielTollenaar DanielTollenaar left a comment

Choose a reason for hiding this comment

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

@visr, if you can describe how I can use the dev env in vscode (using your bat or otherwise) I think all is OK. Checked the envs and dev is indeed pointing to the ribasim-repos at the same level as ribasim-nl

Users need the latest version of pixi: https://prefix.dev/

@@ -0,0 +1 @@
pixi run --environment=dev code . | exit
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still opens vs-code in dev-environment:

  • If I open a new interactive console it uses the default environment
  • with ctrl + shift + P -> Python: select Interpreter -> Enter interpreter path... -> my\path\to\Ribasim-NL\.pixi\envs\dev\python.exe It won't be added to my envs list.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

This should work better once VSCode recognizes pixi environments. Does this work for you? prefix-dev/pixi#411 (comment)

Copy link
Collaborator

@DanielTollenaar DanielTollenaar May 16, 2024

Choose a reason for hiding this comment

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

Reading that issue, you mean selecting the interpeter from the dev-env by this method: https://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter?

Did some more checking; that doesn't work if I try to select the dev-env python.exe, but does work if I try to select the default-env python.exe

But I managed to find a workaround:

  1. start a normal terminal Terminal -> New Terminal (or ctrl+shift+')
  2. this dóes start in the dev-environment if you run vscode in the dev-environment
  3. if you now open a interactive window, it starts to use the dev-environment as wel. And is also appears in the list of python environments to select from

In a screendump:
image

Strange, but I think this is as good as it gets for now, so let's merge :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

That is curious, glad you found a workaround though.

@visr visr merged commit 1eda7f2 into main May 16, 2024
4 checks passed
@visr visr deleted the dev branch May 16, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add dev-environment to pixi.toml
2 participants