-
Notifications
You must be signed in to change notification settings - Fork 906
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Run kedro new
without creating a new directory
#681
Comments
I find it a bit awkward as well that you need to have kedro installed before you have created your project and likely have created your environment. Is it possible to give a cookie-cutter command alternative? Potentially related to this chicken/egg situation of needing to have kedro installed (potentially globally) for project setup that may or may not be the version you are looking for in the project. Is it possible to achieve the same results of Other than |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bump |
Hey @jaklan thanks for the suggestion! It sounds like it might be related to cookiecutter/cookiecutter#909 & cookiecutter/cookiecutter#907 - I suggest you also express your interest there, maybe it'll speed it along for the next |
@WaylonWalker yes that's a valid point, though I'm not sure how it relates to the original question? It feels to me like it deserves its own separate discussion. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I was oblivious to this issue because I was using out-of-tree environments with conda/mamba, but a colleague that just tried to use Kedro with Notice we already have some documentation about using I think it would be good to tag this as "Won't fix" (since it's unlikely that the upstream issue in cookiecutter is ever addressed). I'm going to go ahead and do it, otherwise folks feel free to reverse my decision cc @AntonyMilneQB |
Another side effect of not being able to init a Kedro project in the current directory: users create weird structures with 2 READMEs for nothing, like https://github.com/pablovdcf/TFM_HADO_Cares I know this issue was closed 2+ years ago but honestly it was basically the first pain point I encountered #2360 and it keeps coming up over and over again. I'm reopening so that we can reprioritize. |
This is needed to have venv/virtualenv as first-class citizens in the Kedro installation instructions I think (otherwise the workflow is too weird). An informal poll run by @/brettcannon showed that the majority of developers store virtual environments next to their project code. https://snarky.ca/classifying-python-virtual-environment-workflows/ |
I wonder what an equivalent poll result would look like for Kedro users. I suspect it would be much more biased towards global/central directory due to the prevalence of conda. The point definitely still stands and it would be great if there were a better way to handle in-tree environments, but I would just be cautious assigning priority based on the above poll. It might be worth even doing the same sort of poll for kedro users (or potential kedro users I guess, because there's a selection bias as those who end up using kedro are more likely to be those who had a smooth experience using global environments). Maybe some such poll already exists for data scientists/similar. |
@antonymilne there's no need to overthink that topic and refer to any polls - Kedro should allow people to generate a project in the current directory, period. In-project venvs are absolutely common in the Python ecosystem and they should be simply supported. Especially taking into consideration the fact you can solve the issue with one command moved to Kedro internals. |
How would such function implemented? If i understand correctly cookiecutter still don't support this today, so it need to be implemented in Kedro. Do we need to handle edge cases with existing files? Assuming an empty folder will be easy, would this be good enough? |
@noklam I have already answered that in the initial issue (more than 2 years ago btw...) - you can mimic
Of course no, because the whole discussion is about generating a project in the current directory, because you have
You can simply display a proper warning when running Generally, I see there's also another issue about Poetry itself: #1722, so you need to implement a mechanism to move files anyway if you really want to support it. But there's also another approach - utilise a different, globally installed, CLI tool to initalise Kedro projects - e.g. |
Indeed, cookiecutter does not support this, nothing has changed since #681 (comment) Notice that cookiecutter already has "override/fail if exists" functionality, it's just that it always creates a subdirectory. We'll probably have to move files around. We could start with a conservative stance, like "if any of the files I'm going to create already exists, fail". But this is easier said than done, because then It's actually easier to blindly copy everything over, but this poses data loss risk. copier handles this beautifully, but refactoring kedro away from cookiecutter would be painful: I don't think this is impossible though. Once we agree this is needed, we'll have to carefully think the path of least resistance. |
I never addressed @antonymilne 's point:
And also because we are hiding our venv instructions behind a collapsible menu + the ergonomics are really weird: so I wouldn't be surprised if the current users got sort of used to it. But that's the key trap we have to avoid, and you spelled it out already:
I can run an informal poll in Slack and see what people think. |
On one hand, our over-reliance on conda creates some trouble for certain users. For example, here is a user that is struggling to install a compatible version of Kedro on Python 3.8 because of the pip and setuptools constraints https://linen-slack.kedro.org/t/16034230/hello-i-have-created-a-kedro-matlab-custom-dataset-which-i-w#20e4ffe4-e697-47fa-a722-d74a752b7bed On the other hand, as much as I'd like this to happen, I'm reconsidering how impactful the change would be, because according to an informal survey I ran on Slack, the main annoyance seems to be that users have a "global" Kedro and a project-specific Kedro https://linen-slack.kedro.org/t/16040768/u05bdslpj72-finally-gave-the-steps-in-https-kedro-org-slack-#db2c34ed-43bf-4479-839c-5a4fb4154a10 So much so, that some users don't use However, this points to a new interesting direction that might have even more impact: making |
Issue about improving our installation documentation #3281 |
Notice that, if
At least 2 users consider this second installation step confusing but there's not much else that can be done I believe https://linen-slack.kedro.org/t/16040768/u05bdslpj72-finally-gave-the-steps-in-https-kedro-org-slack-#8a7c5923-7fee-4d46-9229-1ca566b248e8 |
Is there a route where we make |
I don't think so. The problem here is that there are 2 CLI commands that have conflicting purposes:
I don't think there's a way to reconcile these two sets of requirements. |
Slightly out there suggestion - If we had a web ui on the Website for the project add-ons workflow we could then spit out a folder that covers the |
Let me just bump an idea mentioned above:
I believe it would solve many of the issues discussed in that thread. You could install |
@jaklan that would overcome the main limitation I see from installing kedro in pipx, which is the conflicting versions between the local .venv kedro and the global pipx kedro. If the tool only takes up the |
I think this feature is really useful. I use venv inside the root directory of my projects. Normally:
It is not likely that I start my project in an existing one, so problems with pre-existing files is not something I am afraid of. This is a quite simple feature (when explained) but apparently it has many internal tricky parts. I hope you can solve it. 👍 |
Another user complained about this today. |
I would be interested in this and since it has not been mentioned let me add another use case that I guess it will increase in popularity: initializing a project with uv, adding kedro and then wanting a kedro project (or in general wanting to manage a kedro project with uv). As mentioned in this issue Just by comparing the
The kedro initialized project (in this case with all options) has
The main differences I see is that kedro uses More importantly dependencies (and version) are dynamically managed and taken from requirements.txt while uv will manage them directly in the toml file. Given this state, it seems to me that for this case it might be better for me to start with the uv initialized project and try to add kedro content to it. ...and while I finished writing this, I of course looked for it and there is already an issue about using kedro and uv together: #4116 I think it is anyway fair to have this mentioned here, but probably I should follow up the discussion there... |
I'm actually fully aligned with @pietroppeter on this, typically Kedro as a project takes a very conservative approach to integrations. For example, we only started building a VS Code plug-in once we were sure it had won against PyCharm. I'm very much on the asrtral plane so I would love to make a |
@pietroppeter Could you try this?
? |
ahah what is that? :) for ref the toml at the end (from a clean uv init) is:
not sure what the telemetry is about, but I guess that is fair for a new thing... :) edit: added output of
for ref below is the output for the commands:
|
For the gitignore, I usually do
😄 but duly noted! astrojuanlu/kedro-init#4 |
A user:
(and I wholeheartedly agree) |
This is still important for us. As part of a issue cleanup, and in line with a new scheme in which we want to use Discussions for feature requests & enhancement proposals #3767, I'm moving this to a discussion. Let's continue there. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description & Context
Currently, when running
kedro new
I have to specify a folder where my project is created. It does't make sense when I usevenv
or Poetry with in-project venv, because I have to create a directory by myself anyway to init a venv and install Kedro there. As a result, I have to manually move the new project to the upper folder withmv ~/repos/project_name/project_name/* ~/repos/project_name/
.Possible Implementation
Add flag to skip creating a folder.
Possible Alternatives
Ask about it during init.
The text was updated successfully, but these errors were encountered: