-
Notifications
You must be signed in to change notification settings - Fork 906
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
Default template incompatible with uv
, rye
, pdm
#4116
Comments
uv
uv
, rye
, pdm
(Writing this with (For the record, the default template is also incompatible with Poetry, but for different reasons. This might change once Poetry 2.0 ships with PEP 621 support. For now, we're not making any effort to support Poetry, see #1722.) Notice that there's not such thing as "migrating the template to So there's several things we can do about this issue:
|
Small sample of two people here but I will say after the most recent changes to uv I'd really love to see alignment between this project and uv. Makes 100% sense why Kedro is the way it is given the ubiquity and common practice of using pip, but I'm also seeing more projects move in the this better direction that rye/uv/poetry are taking. Thanks for thinking about it in the meantime. |
I am very new to both kedro and uv but I am wondering, is it possible as a first step to have a starter template that will have the same toml setup as uv? (see also #681 (comment)) |
Workaround from #681 (comment) :
In principle we'd like to avoid the proliferation of starters. Switching to a static Watch this space and thanks for the patience 🙏🏼 |
sounds reasonable (wishing to avoid templates). as reported here #681 (comment) the workaround works for me and it seems that the rest of the missing things to add are straightforward (I honestly do not mind adding them one by one, it helps me understand better the system instead of using a template). Thanks for the support, I am much more confident now in starting with uv and kedro together and will keep a look on how it evolve this. Have a great day! |
I said users can be educated over a year ago in the thread you linked:
#2569 (comment)
I think it's well past time Kedro following modern best practices--this was
always part of the value prop of the template.
I don't like the weird `requirements.txt` with just `-e .` in there; if you
want to document an alternative path in the FAQ, fine, but people shouldn't
be defaulting to this weird flow.
…On Tue, Aug 27, 2024, 4:48 AM Pietro Peterlongo ***@***.***> wrote:
sounds reasonable (wishing to avoid templates).
as reported here #681 (comment)
<#681 (comment)>
the workaround works for me and it seems that the rest of the missing
things to add are straightforward (I honestly do not mind adding them one
by one, it helps me understand better the system instead of using a
template).
Thanks for the support, I am much more confident now in starting with uv
and kedro together and will keep a look on how it evolve this. Have a great
day!
—
Reply to this email directly, view it on GitHub
<#4116 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADK3W3R44AOO63SBCEZRC43ZTRKOHAVCNFSM6AAAAABNAFJ5LCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJSGE4DINZVGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Another workaround: https://github.com/astrojuanlu/copier-kedro |
@deepyaman Yeah and back then I was still on the fence... On one hand, yes people should understand that library workflows need However,
That being said, I admit that my
in other words, ship a fully resolved and universal |
We discussed this on 2024-08-28 Tech Design. Some notes:
Extra links:
|
From the 2023 Python survey https://lp.jetbrains.com/python-developers-survey-2023/ |
Another thing we should probably amend:
Our template and starters should have a |
I ran the two commands to get the copier to run successfully and messed around to try and get uv working with Kedro. The only issue is that it didn't create a few of the folders like notebook and data (and it's child folders). Did I do something wrong or is there a different way to do this? |
@Vaslo good point. Try again :) |
This edition is great! Thank you for taking a few minutes to do this. I'll work with this process until all the uv stuff is a little more mature. I'm having a few issues with a package on that end that I'm trying to iron out as well, but it's forcing me to learn both the Kedro and uv way. |
Things to do:
|
A bit more data to support this: (query) |
I'm starting to muck around with I'm only at the point of doing the tutorial (which I'm going to continue tomorrow), but I think the only QoL feature I would like as a PDM user is to have the EDIT: A few minor conflicts came up when I tried to package the spaceflights demo:
|
Regarding the possibility of putting This does work when testing manually, but when running this change through our CI, Behave does not play well with it and it causes our e2e tests to fail.
Using only Because of that plus the fact that we're using the What do you guys think? |
Hmm I think that error has more to do with how do we manually unpack the Lines 126 to 134 in 974c517
In the end, this will be calling
|
Reposting what I posted previously on slack here, on the matter of requirements.txt: Found a possible workaround for the requirements.txt file issue. Putting "-e" + the absolute path to the project instead of "-e ." on requirements.txt will work when running Something like: result_path = cookiecutter(template=template_path, **cookiecutter_args)
with open(result_path + "/requirements.txt", "w") as requirements_file:
requirements_file.write("-e " + result_path) However, because during the tests we pull the latest release of kedro-starters (and that fallback we implemented earlier will not help here because there is no version change), the tests will still break because it's pulling the version of the starter pyproject files that is using dynamic dependencies and pointing to requirements.txt So I think the easiest way to handle this would be: Merge #4263 and kedro-org/kedro-starters#246 as they are. Then, after the next Kedro release, make the changes to deal with requirements.txt. It will be easier to test then, and it's easier to guarantee it won't break any of the existing workflows. |
Note that Rye is just using uv under-the-hood: astral-sh/rye#1342 |
Does this incompatibility also exist for Hatch? |
@galenseilis Even though there's no |
Thanks for looking into that! I also had not noticed that the CLI commands for hatch are not as flushed out as the other tools. Thank you for raising my awareness of that. |
Description
uv add <dep>
fails with our default template (projects created withkedro new --tools
).(And so do
rye
andpdm
)Updated after tech design:
Things to do:
Context
uv
expects to be able to write to the[project.dependencies]
table, but we're using dynamic dependencies, so in a way this is expected to fail:kedro/kedro/templates/project/{{ cookiecutter.repo_name }}/pyproject.toml
Line 8 in 56e56a7
Steps to Reproduce
Expected Result
Success (no changes to
pyproject.toml
,uv.lock
is created)Actual Result
Your Environment
pip show kedro
orkedro -V
): 0.19.8python -V
): 3.12The text was updated successfully, but these errors were encountered: