Skip to content

Commit

Permalink
More correctly work around uv sync issue with python 3.10+ only dep (
Browse files Browse the repository at this point in the history
…#43227)

Just having the python_version requirement doesn't seem to correctly make uv
"fork" the resolver path (Charlie's words/terms), so we either need to specify
both module versions here. The other option that could work is putting this in
our pyproject.toml

```
[tool.uv]
environments = ["python_version >= '3.10'", "python_version < '3.10'"]
```

But having both versions specified keeps the fix localized into the provider
so I have chosen this approach.

This is likely why the exclued-python-version setting we already had wasn't
working for uv sync.


astral-sh/uv#4668
  • Loading branch information
ashb authored Oct 21, 2024
1 parent 979d750 commit db6e103
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions generated/provider_dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@
"cloudant": {
"deps": [
"apache-airflow>=2.8.0",
"ibmcloudant==0.7.0 ; python_version < \"3.10\"",
"ibmcloudant==0.9.1 ; python_version >= \"3.10\""
],
"devel-deps": [],
Expand Down
7 changes: 5 additions & 2 deletions providers/src/airflow/providers/cloudant/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ versions:

dependencies:
- apache-airflow>=2.8.0
# Even though 3.9 is excluded below, we need to make this python_version aware so that `uv` can generate a
# full lock file when building lock file from provider sources
# Even though 3.9 is excluded below, we need to make this python_version aware so that `uv` (at least as of
# 0.4.25) can generate a full lock file when building lock file from provider sources. Seeing the duplicate
# dep makes the UV resolver correctly "fork" and try to come up with alternative solutions.
# https://github.com/astral-sh/uv/issues/4668
- 'ibmcloudant==0.9.1 ; python_version >= "3.10"'
- 'ibmcloudant==0.7.0 ; python_version < "3.10"'

excluded-python-versions:
# ibmcloudant transitively brings in urllib3 2.x, but the snowflake provider has a dependency that pins
Expand Down

0 comments on commit db6e103

Please sign in to comment.