-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use uv project interface in template #36
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So now we can use uv
directly without creating a virtual environment? Do we need to do some previous step to do this (like for generating the uv.lock file or something)?
@@ -111,6 +138,11 @@ skip-magic-trailing-comma = false | |||
# Like Black, automatically detect the appropriate line ending. | |||
line-ending = "auto" | |||
|
|||
[tool.uv] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not always working in MacOS (I think depending on the version) and Windows, and in Ubuntu Bernadette was also having the same issue. I saw all of this during the hackathon last week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure they were not using just pip
here? This is just the equivalent to passing the argument in the CLI.
### Template update | ||
|
||
We use cruft to update the project based on template changes. A `cruft-update.yml` is included in Github workflows to automatically check for updates and create pull requests to apply updates. Follow the [instructions](https://github.blog/changelog/2022-05-03-github-actions-prevent-github-actions-from-creating-and-approving-pull-requests/) on how to enable Github Actions to create pull requests. | ||
We use cruft to update the project based on template changes. A `cruft-update.yml` is included in Github workflows to automatically check for updates and create pull requests to apply updates. Follow the [instructions](https://github.blog/changelog/2022-05-03-github-actions-prevent-github-actions-from-creating-and-approving-pull-requests/) on how to enable Github Actions to create pull requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cruft update is never working (as the changes are a bit too hard to track), so I doubt anyone is ever going to accept these changes, and the email notifications are a bit annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, maybe we can just keep the local command and remove the CI step.
```sh | ||
pip install --upgrade pip | ||
``` | ||
We highly recommend using `uv` to manage the project. Consider installing `uv` by following the official installation [guide](https://docs.astral.sh/uv/getting-started/installation/#installing-uv). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do not send people people to read some other documentation in another package management. Can you add a better explanation + step-by-step as it was before? Think that people is not going to open that uv guide (not even me), so is uv
replacing the virtual environment? Can you summarize how uv manages projects in 1 or 2 lines?
```sh | ||
pip install uv | ||
``` | ||
Read the short [guide](https://docs.astral.sh/uv/guides/projects/) on how to manage projects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment.
```sh | ||
uv pip install -e '.[dev]' --index-url https://gitlab.mpcdf.mpg.de/api/v4/projects/2187/packages/pypi/simple | ||
uv sync --extra-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is new and I wrote a comment before regarding the tool.uv part with the index-url. So maybe you can ask Bernadette if this works for her? And maybe others in the team?
This should probably be discussed in the plugin meeting so that people can voice their opinion. |
Yes, you won't have to manually manage the environment.
Makes sense, I will create a short intro for this and how to develop multiple plugins locally. In the mean time maybe Chema and others can try it out and see if it's helpful. |
uv
project interface.It's still compatible with standard pip if a user doesn't want to use
uv
.