mruoss
Hi
Does somebody know if there’s a way to access the special cell pyproject.toml that is created when initializing Python in a Livebook from an Elixir cell? I’d just need the blob as a string.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
josevalim
It doesn’t seem there is a straight-forward location to fetch it. What is the use case?
mruoss
The use case is to reuse it to initialize Python in a FLAME runner. But I guess I can just not use that cell and create a module/function for initializing Python and use that on both sides (in the livebook and in the FLAME runner)
josevalim
Ah, that’s something we want to explore. Honestly, I would instead try to find the folder where the Python packages are and transfer them as is instead. No need to download it again.
mruoss
Tried. Failed…
There might actually be a small bug in FLAME’s
copy_pathsoption.https://github.com/phoenixframework/flame/issues/83
mruoss
I manage to copy all the things over to the runner but somehow it still says Python is not initialized… might dig a bit more…
mruoss
Alright, I managed to sync the entire pythonx cache directory by passing the following option to the FLAME pool:
However, I still need to run
Pythonx.uv_init(my_toml)in order to initialize the NIF? But with the .venv in place, it won’t download stuff anymore. I still need that toml though, but that’s only because there’s currently no function to get the current project path inside.cache/pythonx. If I knew that, I could also only sync that project and didn’t have to sync the entire cache folder with all the projects in it. Plus, I could probably derife the necessary arguments to callPythonx.NIF.init().So I guess all in all the Pythonx module API could be improved for this use case but technically it’s not far from supporting it…?
josevalim
Yes, it is not something we support yet but we want to make Pythonx work out of the box with FLAME, so any progress or PRs you can send along those lines will be welcome.
For example, we may be fine with moving the TOML to the .cache/pythonx, at least you can try it in a fork and see if that unblocks you.
mruoss
Happy to support once we have an approach.
It’s a bit of a chicken/egg problem if I understand correctly. So when running in Livebook, the pyproject TOML is actually already inside
.cache/pythonx. Concretely it’s in.cache/pythonx/PYTHONY_VERSION/uv/UV_VERSION/projects/MD5_OF_TOML/pyproject.toml. But without the toml it’s impossible to calculate thatMD5_OF_TOMLand derive the directory.josevalim
Perhaps uv_init should return the path to said project, and then we can keep it internally in Livebook or expose it as a var?
mruoss
Yes that would probably work.