adamant-salesmen-34590
11/11/2024, 2:22 AMsquare-wire-39606
11/11/2024, 2:23 AMadamant-salesmen-34590
11/11/2024, 2:39 AMsquare-wire-39606
11/11/2024, 2:45 AMdry-beach-38304
11/11/2024, 4:53 AMuv init
, there is no need for that with metaflow environments — just writing your flow will “init” the enviornment for you. It’s true there is no portable file for it. That’s something that could potentially be added.
• for uv run
, running a metaflow flow will run it in the proper enviroment (and it should be fast the second time around)
• for uv add
, it should also do it “automatically” when you try re-running the flow.
The nextflix extensions has a bit more in terms of “commands” for environments so you can also check that out and see if that helps a bit.adamant-salesmen-34590
11/11/2024, 11:48 AMrefined-insurance-51213
02/13/2025, 3:55 PMpyproject.toml
in the extension would be a really great add, especially if it can support different dependency-groups
. I hope that the above uv
issue can be resolved soon! 🙏dry-beach-38304
02/13/2025, 6:14 PMsquare-wire-39606
04/21/2025, 9:08 PMuv run python flow.py --environment=uv run --with kubernetes
square-wire-39606
04/21/2025, 9:09 PMdry-beach-38304
04/21/2025, 9:48 PMrefined-insurance-51213
04/21/2025, 10:03 PMOSError: Readme file does not exist: README.md
among other things. I wonder if that's because I also have a python package that it's wanting to install in editable mode (I normally symlink that package under my flows
directory). Maybe a --no-install-project
flag is needed. Just wanted to flag it here, happy to wait as this functionality develops further.square-wire-39606
04/22/2025, 12:24 AMsquare-wire-39606
04/22/2025, 1:35 AMrefined-insurance-51213
04/22/2025, 1:35 PM[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
which is needed to treat my code as a proper python package outside of Metaflow. If this is commented out, the uv dependencies build fine, and the package code is handled via a symlink.lively-lunch-9285
04/22/2025, 7:46 PMsrc.
to your imports
a. makes it so unit tests and flows can have the same import path
b. and just generally is more consistent with Python standards (not putting src.
in imports)
3. have those packages end up in the metaflow code package even if they aren't in a child directly of flow.py
a. achieve this without having to build/publish the folder to PyPI or do a self-referential git+https://...
statement (really overkill e.g. for 3 helper files)dry-beach-38304
04/22/2025, 8:02 PMrefined-insurance-51213
05/21/2025, 9:04 PMreadme = "README.md"
from the pyproject.toml
(obviously 🙂)
2. Instead of symlinking the package name directly (here, called metaflow_uv
), symlink src
because that's what uv
expects to find to install the local package in editable mode. So now the package is actually installed when the flow is running, and not hanging out in the local path of the flow itself. (Distinction without a difference in this case, but necessary for uv
)
The repo is updated.