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

[FLINK-36900][python] Migrate from conda to uv for managing Python environments for PyFlink #26065

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

autophagy
Copy link
Contributor

What is the purpose of the change

Given the issues raised in https://issues.apache.org/jira/browse/LEGAL-688, we've decided to move away from using conda. conda is being used in Flink in the following ways:

  • Setting up PyFlink developer environments.
  • Setting up a range of environments with different Python versions (3.8, 3.9, 3.10, 3.11) to both validate the Flink apis over those versions, and to build Python wheels for those versions.
  • Setting up a Python environment for use in building the binary releases.
  • Setting up a Python environment or the PyFlink, PyFlink Yarn and PyFlink Kubernetes end-to-end tests.

To summarise, conda is largely being used for the creation of Python virtual environments for both developers and CI. This PR replaces conda with uv, a fast Python package and virtual environment manager. In the cases where conda was being used to manage non-python packages (for example, installing the zip binary in the PyFlink yarn tests) this has instead been changed to use the package manager native to the environment (apt, in this particular case).

Brief change log

  • Replaced conda with uv for managing the creation of Python environments and installing Python packages for PyFlink in both testing, wheel building and developer contexts.
  • Added tox-uv so that tox can manage the Python environments it uses via uv.

Verifying this change

This change is already covered by existing tests, such as:

  • PyFlink end-to-end tests

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (no)

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 23, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

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