Skip to content

Enable package-centric development with uv#21016

Closed
jmchilton wants to merge 7 commits intogalaxyproject:devfrom
jmchilton:uv_packages
Closed

Enable package-centric development with uv#21016
jmchilton wants to merge 7 commits intogalaxyproject:devfrom
jmchilton:uv_packages

Conversation

@jmchilton
Copy link
Copy Markdown
Member

@jmchilton jmchilton commented Oct 7, 2025

A current problem with isolated Python packages view of Galaxy is that in order to setup a virtual environment that uses a package - you'd need to manually walk the informal dag and setup each dependent package manually. I think this can be solved with UV workspaces and then we can have standalone simple targets to set this all up for individual package development automatically and in my hands very rapidly.

This should in turn let us point an AI coding agent at an individual package and give it free reign to lint, type, and test code the rapidly and isolation without needing to consider the broader application's structure or dealing with dependencies in an ad hoc manner. The advantages of pointing AI agents at smaller directories is I think huge - the smaller the context you give these agents the more efficiently and effectively they can write code.

See the README.md added for user facing details. I think this formalizes the treatment of dependencies between our packages when using uv (uv workspaces specifically). This does introduce a bit of redundancy because the packages cannot share a pyproject.toml - but I've written a script to synchronize these from a common template so I think this is a non-issue. Longer term this should probably be inverted and pyproject.toml should be the source of truth and setup.cfg dropped. I've changed test requirements into a new set of extras instead of managing them externally in a test-requirements.txt - this is so uv can see them automatically.

$ git clone https://github.com/galaxyproject/galaxy.git
$ cd galaxy/packages/auth
$ uv sync --all-extras
$ uv run pytest tests

I think this might also negate the need to track the dag and allow us to do better isolated testing of the packages if we rewrite tests.sh - but that feels like a round 2 sort of thing.

The above paradigm demonstrates how to run tests in isolation now but I've added Makefile targets and docs for doing that as well as for linting with ruff and running mypy. I wasn't able to get formatting working with black - the problem is this line https://github.com/psf/black/blob/main/src/black/__init__.py#L763 - black won't format symlinks outside of root and I don't see a way in their codebase to bypass this.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@jmchilton jmchilton marked this pull request as ready for review October 7, 2025 23:39
@github-actions github-actions Bot added this to the 26.0 milestone Oct 7, 2025
@mvdbeek mvdbeek self-requested a review October 14, 2025 14:08
@nsoranzo
Copy link
Copy Markdown
Member

I think most of the changes in this PR have already been merged as part of #21102 .

@jmchilton jmchilton closed this Oct 30, 2025
@jmchilton
Copy link
Copy Markdown
Member Author

@nsoranzo Indeed and some bug fixes I found by actually using this mode of development more and for more packages - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants