Skip to content
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

Rewrite build.yml to better utilize uv #3725

Open
dangotbanned opened this issue Dec 30, 2024 · 0 comments
Open

Rewrite build.yml to better utilize uv #3725

dangotbanned opened this issue Dec 30, 2024 · 0 comments

Comments

@dangotbanned
Copy link
Member

dangotbanned commented Dec 30, 2024

What is your suggestion?

Been on my mind following (3513259) and (#3719)

I think we could simplify the workflow by using dependency-groups (Local dependencies for development).

So instead of all the branches where we conditionally install/uninstall stuff - we declare some groups to use in the workflow.

Example

We currently can only know what this environment actually resolves to by looking at the logs, after the run:

Maybe uninstall optional dependencies

- name: Maybe uninstall optional dependencies
# We uninstall pyarrow and vegafusion for one job to test that we have not
# accidentally introduced a hard dependency on these libraries.
# Uninstalling for Python 3.9 is an arbitrary choice.
# Also see https://github.com/vega/altair/pull/3114
if: ${{ matrix.python-version == '3.9' }}
run: |
uv pip uninstall pyarrow vegafusion vegafusion-python-embed vl-convert-python anywidget

Instead, we could define the state we're testing for by a new group:

[dependency-groups]
ci-no-optional = [
  # ...,
  # ...,
]

Then both build.yml and locally we can test this in the same way:

>>> uv sync --group "ci-no-optional"
>>> uv run tools/generate_schema_wrapper.py
>>> ...

Note

We would still have some branching, but that would only be passing in the --group/ --extra options.

Benefits

Have you considered any alternative solutions?

No response

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

No branches or pull requests

1 participant