Tweaks to better support use of uv#1705
Conversation
- Change how license details are given (previous way was deprecated) - Use version_file instead of write_to for setuptools_scm (write_to is deprecated) - Move the test, docs, and dev optional dependencies to be dependency groups instead (assuming that those dependencies are not intended for users to install) - Added matplotlib to the test dependency group (it's used in some of the tests)
…t let one specify dependency groups to include
There was a problem hiding this comment.
Hi @gavinmacaulay, that’s great, thank you! I tested it and managed to create my environment, and it was quicker than using conda, so i think we’re ready to merge! The only thing is that it would be nice to update the development installation documentation (https://github.com/echostack-org/echopype/blob/main/docs/source/contrib_setup.md) to reflect the changes to pyproject.toml and add the uv setup? could you add that to this PR?
EDIT: after running uv sync i had an untracked uv.lock. Should we commit it or add to .gitignore if we don’t intend to track it?
should we also put forward uv as the recommended installation method for development? @leewujung what do you think? We would still leave Conda as an option ofc, as it still works with the changes to pyproject.toml. cheers!
|
Closes #1449 |
|
I'll add uv instructions to the docs in the next day or so. I think the |
|
Forgot to reply to your uv.lock question - yes, that should be in git. I left it out because it sets the versions of all the dependencies to use in the virtual environment that uv creates and hence what people end up using when developing echopype and that wasn't a choice I should be making 😄 |
|
ok nice! we'll be sitting down with @leewujung and @ctuguinay on Tuesday, and we can discuss those points then! cheers! :) |
|
Uv-specific docs added in f1090c6. Having the docs explain both conda and uv makes it a bit complicated to follow without doing a larger reorganisation of the relevant doc pages. The edits to the testing part of the docs are unfinished (I need to test out the .ci_helpers code with uv to check that it works). |
|
I'm finished with the uv doc edits now. |
|
Hi @gavinmacaulay thx you very much! I tested both setup methods again and just proposed a few small changes in the latest commit! For isntance, it seems that uv build only creates distribution artifacts, so I replaced it with uv sync which creates .venv and installs echopype in editable mode. i also updated installation commands to use --group (since dev, test, and docs are now dependency groups rather than optional extras?) and fixed Conda environment-name mismatch (small typo from a previous PR i did) and added ipykernel to the dev group! Feel free to adjust anything if you disagree with these changes. Cheers! :) |
|
Good to have an independent test of the doc instructions! If a uv sync includes groups, then it's not necessary to specify those groups when running particular commands (also, the dev group is always automatically installed by uv). Apparently, the recommended way is to include all the required groups in the sync command (less churn with adding and removing groups with particular commands). This can be automated with a default-groups setting in pyproject.toml, so I'll do a commit with that shortly and remove the --group test options. |
for more information, see https://pre-commit.ci
LOCEANlloydizard
left a comment
There was a problem hiding this comment.
ok great! i think we're good to merge, thx @gavinmacaulay!!
Minor adjustments that help when using uv instead of conda/pip:
uv build, there are otherwise extras in the package for test, docs, and dev)uv run --group test pytest, pytest wasn't finding matplotlib because it's not an echopype dependency)