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

Add UV support to venv operators #43612

Merged

Conversation

jscheffl
Copy link
Contributor

@jscheffl jscheffl commented Nov 2, 2024

Follow-up on #43553 and #43568

Adds support for UV for the VirtualEnv operators.

Don't know if it is acceptable like this, it is auto-detecting: if UV is installed then it is using UV.
Do we need to make this configurable or is an auto-detection sufficient?

@potiuk
Copy link
Member

potiuk commented Nov 2, 2024

I'd say:

  • add parameter to switch between uv and pip (no auto-detection - too much risk)
  • add unit tests :)

@jscheffl
Copy link
Contributor Author

jscheffl commented Nov 2, 2024

I'd say:

* add parameter to switch between uv and pip (no auto-detection - too much risk)

With the follow-up question(s):

  • What to default?
  • Adding a config entry or forcing all DAGs do be adjusted for this param?

Proposal:

  • Option "AUTO", "PIP", "UV" as Enum
    • AUTO=Like now, checks if UV is installed, if not uses pip
    • The other options: How the user likes it
  • Default is configurable and uses "AUTO" as default as provider config property

Alternatively we can also make it like attept UV and if it fails attempt pip as fallback?

Copy link
Member

@gopidesupavan gopidesupavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small change :)

@gopidesupavan
Copy link
Member

I'd say:

* add parameter to switch between uv and pip (no auto-detection - too much risk)

With the follow-up question(s):

  • What to default?
  • Adding a config entry or forcing all DAGs do be adjusted for this param?

Proposal:

  • Option "AUTO", "PIP", "UV" as Enum

    • AUTO=Like now, checks if UV is installed, if not uses pip
    • The other options: How the user likes it
  • Default is configurable and uses "AUTO" as default as provider config property

Alternatively we can also make it like attept UV and if it fails attempt pip as fallback?

I feel like default to UV is better, as now we are completely moving towards UV, so if user want to switch they can update?

@jscheffl jscheffl force-pushed the feature/add-uv-support-to-venv-operator branch from f083716 to 212cfb6 Compare November 3, 2024 18:29
@potiuk
Copy link
Member

potiuk commented Nov 3, 2024

Option "AUTO", "PIP", "UV" as Enum
AUTO=Like now, checks if UV is installed, if not uses pip

Yes. It's good I think. Needs to be followed up with newsfragment explaining it.

@jscheffl jscheffl force-pushed the feature/add-uv-support-to-venv-operator branch from 212cfb6 to 4f439ce Compare November 4, 2024 19:51
Co-authored-by: GPK <gopidesupavan@gmail.com>
…nv.py

Co-authored-by: GPK <gopidesupavan@gmail.com>
@gopidesupavan
Copy link
Member

LGTM :)

@jscheffl jscheffl merged commit 286075f into apache:main Nov 4, 2024
56 checks passed
@set5think
Copy link
Contributor

@jscheffl WOW THANKS FOR TAKING THIS TO THE FINISH LINE!!! It's amazing to see how simple it was to add what I think is an extremely valuable contribution!!! GOOD JOB! ❤️

@Lee-W
Copy link
Member

Lee-W commented Nov 7, 2024

just saw it on slack. love this one!

ellisms pushed a commit to ellisms/airflow that referenced this pull request Nov 13, 2024
* Add UV support to venv operators

* Uups, allow creation also when requirements+pip.conf are used

* Fix venv numpy example which needs to be 1.26 at least to be working in Python 3.12

* Review feedback and pytests

* Fix pytests

* Revert fix in examples

* Add newsfragment

* Update providers/src/airflow/providers/standard/provider.yaml

Co-authored-by: GPK <gopidesupavan@gmail.com>

* Update providers/src/airflow/providers/standard/utils/python_virtualenv.py

Co-authored-by: GPK <gopidesupavan@gmail.com>

---------

Co-authored-by: GPK <gopidesupavan@gmail.com>
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.

5 participants