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

⚡ migrate to uv for packaging #23814

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

⚡ migrate to uv for packaging #23814

wants to merge 2 commits into from

Conversation

danielgafni
Copy link
Contributor

@danielgafni danielgafni commented Aug 22, 2024

Summary & Motivation

Internal discussion: https://github.com/dagster-io/internal/discussions/11123

How I Tested These Changes

Changelog [New | Bug | Docs]

Replace this message with a changelog entry, or NOCHANGELOG

@danielgafni danielgafni marked this pull request as draft August 22, 2024 00:20
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @danielgafni and the rest of your teammates on Graphite Graphite

@zanieb
Copy link

zanieb commented Aug 22, 2024

Feel free to ping me if you need anything. We're very interested in the workspace concept working for Dagster.

Copy link

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-23g2vsazm-elementl.vercel.app
https://uv-migration.dagster.dagster-docs.io

Direct link to changed pages:

@danielgafni
Copy link
Contributor Author

Made some progress with this: migrated all packages to pyproject.toml and registered them in uv workspaces.

Current problem: uv lock fails because we have both airflow 1 and airflow 2 tests.

warning: Missing version constraint (e.g., a lower bound) for `lkml`
  × No solution found when resolving dependencies for split (python_full_version < '3.12'):
  ╰─▶ Because dagster-airflow[test-airflow-1] depends on apache-airflow>=1.0.0,<2.0.0 and dagster-airflow[test-airflow-2] depends on apache-airflow>=2.0.0,<2.8, we can conclude that dagster-airflow[test-airflow-1] and dagster-airflow[test-airflow-2] are incompatible.
      And because your workspace requires dagster-airflow[test-airflow-1] and dagster-airflow[test-airflow-2], we can conclude that your workspace's requirements are unsatisfiable.

@zanieb
Copy link

zanieb commented Aug 22, 2024

Ah yes the resolver needs to solve for all extras in the workspace. Let me check-in with the team to see if we have a recommended workaround.

@danielgafni
Copy link
Contributor Author

Hey @zanieb, just checking, are there any updates on this?

I understand that mutually exclusive dependency groups is not a trivial feature to implement.

Do you have plans for this at all? If not, is there a recommended workaround?

@zanieb
Copy link

zanieb commented Sep 20, 2024

@danielgafni we've been talking about this quite a bit internally, especially in the context of PEP 735 — I think we'll try to implement something for this in the near future but yeah it's hard. I don't think we have a good workaround at the moment, but I'll check with the rest of the team.

@zanieb
Copy link

zanieb commented Sep 23, 2024

There's a tracking issue at astral-sh/uv#6981

BurntSushi added a commit to astral-sh/uv that referenced this pull request Nov 13, 2024
This PR adds support for conflicting extras. For example, consider
some optional dependencies like this:

```toml
[project.optional-dependencies]
project1 = ["numpy==1.26.3"]
project2 = ["numpy==1.26.4"]
```

These dependency specifications are not compatible with one another.
And if you ask uv to lock these, you'll get an unresolvable error.

With this PR, you can now add this to your `pyproject.toml` to get
around this:

```toml
[tool.uv]
conflicting-groups = [
    [
      { package = "project", extra = "project1" },
      { package = "project", extra = "project2" },
    ],
]
```

This will make the universal resolver create additional forks
internally that keep the dependencies from the `project1` and
`project2` extras separate. And we make all of this work by reporting
an error at **install** time if one tries to install with two or more
extras that have been declared as conflicting. (If we didn't do this,
it would be possible to try and install two different versions of the
same package into the same environment.)

This PR does *not* add support for conflicting **groups**, but it is
intended to add support in a follow-up PR.

Closes #6981

Fixes #8024

Ref #6729, Ref #6830

This should also hopefully unblock
dagster-io/dagster#23814, but in my testing, I
did run into other problems (specifically, with `pywin`). But it does
resolve the problem with incompatible dependencies in two different
extras once you declare `test-airflow-1` and `test-airflow-2` as
conflicting for `dagster-airflow`.

NOTE: This PR doesn't make `conflicting-groups` public yet. And in a
follow-up PR, I plan to switch the name to `conflicts` instead of
`conflicting-groups`, since it will be able to accept conflicting extras
_and_ conflicting groups.
@zanieb
Copy link

zanieb commented Nov 15, 2024

@danielgafni heads up — we just released support for declaring conflicting extras.

@danielgafni
Copy link
Contributor Author

You guys rock!

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

Successfully merging this pull request may close these issues.

2 participants