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

Find a better solution to manage python version #45

Open
josephjclark opened this issue Apr 24, 2024 · 0 comments
Open

Find a better solution to manage python version #45

josephjclark opened this issue Apr 24, 2024 · 0 comments
Labels
platform An issue related to the typescipt/bun platform

Comments

@josephjclark
Copy link
Collaborator

We have a little problem in our node-python set up

Right now, the node version is hard-coded in pyproject.toml and platform/src/bridge.ts. If the local python version drifts from this, the python bridge will break.

The problem is that we need to tell node-calls-python where the poetry environment is. And the poetry environment uses the minor python version in the path:

.venv/lib/python${PYTHON_VERSION}/site-packages

I have tried to write a function to scrap the python version from the shell. Bun has lovely apis for this. But the solution feels so flaky.

Hard-coding the python version, weirdly, actually feels like the best solution.

Possible solutions:

  • I've love venv to just sit in a static dir like .venv/lib. How can we configure poetry to generate that path with -in-project true? If the user installs a new python version then modules might break, but you're only a rimraf .venv && poetry install away from a fix.
  • Alternatively, there must be some poetry command which will give us the full path to the local lib? Surely? But I can't find it.
@github-project-automation github-project-automation bot moved this to New Issues in v2 Apr 24, 2024
@christad92 christad92 moved this from New Issues to Icebox in v2 Apr 29, 2024
@josephjclark josephjclark changed the title Find a better solution to manage python Find a better solution to manage python version Apr 30, 2024
@josephjclark josephjclark added the platform An issue related to the typescipt/bun platform label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform An issue related to the typescipt/bun platform
Projects
Status: Icebox
Development

No branches or pull requests

1 participant