amoghrajesh commented on code in PR #43604:
URL: https://github.com/apache/airflow/pull/43604#discussion_r1826601114


##########
contributing-docs/07_local_virtualenv.rst:
##########
@@ -61,26 +62,114 @@ of required packages.
    released wheel packages.
 
 
-Installing Airflow
-..................
+Creating and maintaining local virtualenv with uv
+-------------------------------------------------
+
+As of November 2024 we are recommending to use ``uv`` for local virtualenv 
management for Airflow development.
+Th e``uv`` is a build frontend tool that is designed to manage python, 
virtualenvs and workspaces for development
+and testing of Python projects. It is a modern tool that is designed to work 
with PEP 517/518 compliant projects
+and it is much faster than "reference" ``pip`` tool. It has extensive support 
to not only create development
+environment but also to manage python versions, development environments, 
workspaces and Python tools used
+to develop Airflow (via ``uv tool`` command - such as ``pre-commit`` and 
others, you can also use ``uv tool``
+to install ``breeze`` - containerized development environment that we use to 
be able to reproduce the
+CI environment locally and to run release-management and certain development 
tasks.
+
+You can read more about ``uv`` in `UV Getting started 
<https://docs.astral.sh/uv/getting-started/>`_ but
+below you will find a few typical steps to get you started with ``uv``.
+
+Installing uv
+.............
+
+You can follow the `installation instructions 
<https://docs.astral.sh/uv/getting-started/installation/>`_ to install
+``uv`` on your system. Once you have ``uv`` installed, you can do all the 
environment preparation tasks using
+``uv`` commands.
+
+Installing Python versions
+..........................
+
+You can install Python versions using ``uv python install`` command. For 
example, to install Python 3.9.7, you can run:
+
+.. code:: bash
+
+    uv python install 3.9.7
+
+This is optional step - UV will automatically install the Python version you 
need when you create a virtualenv.
+
+Creating virtualenvs with uv
+............................
+
+.. code:: bash
+
+    uv venv
+
+This will create a default venv in your project's ``.venv`` directory. You can 
also create a venv
+with a specific Python version by running:
+
+.. code:: bash
+
+    uv venv --python 3.9.7
 
-The simplest way to install Airflow in local virtualenv is to use ``pip``:
+You can also create a venv with a different folder name by running:
 
 .. code:: bash
 
-    pip install -e ".[devel,<OTHER EXTRAS>]" # for example: pip install -e 
".[devel,google,postgres]"
+    uv venv .my-venv
+
+However UV creation/re-creation of venvs is so fast that you can easily create 
and delete venvs as needed.
+So usually you do not need to have more than one venv and recreate it as 
needed - for example when you
+need to change python version
+
+Syncing project (including providers) with uv
+.............................................
+
+In a project like airflow it's important to have a consistent set of 
dependencies across all developers.
+You can use ``uv sync`` to install dependencies from ``pyproject.toml`` file. 
This will install all dependencies
+from the ``pyproject.toml`` file in the current directory.
+
+.. code:: bash
+
+    uv sync
+
+If you also need to install development and provider dependencies you can 
specify extras for that providers:
+
+.. code:: bash
+
+    uv sync --extra devel --extra devel-tests --extra google
+
+This will synchronize all extras that you need for development and testing of 
Airflow and google provider
+dependencies - including their runtime dependencies.
+
+.. code:: bash
+
+    uv sync --all-extras

Review Comment:
   Good enough. Makes sense



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to