You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/08/09 06:48:07 UTC

[airflow] branch main updated: Move the old ./breeze script to scripts/tools/setup_breeze (#25584)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1594d77063 Move the old ./breeze script to scripts/tools/setup_breeze (#25584)
1594d77063 is described below

commit 1594d7706378303409590c57ab1b17910e5d09e8
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Tue Aug 9 08:47:55 2022 +0200

    Move the old ./breeze script to scripts/tools/setup_breeze (#25584)
    
    We used to use Breeze via ./breeze script in the main airflow
    folder, but it's already long enough time after new breeze
    introduction to get-rid of it. However, the Bash script itself
    is pretty useful to automate Breeze installation on POSIX-compliant
    OS-es, so turning it into an installation script seems like a good
    idea.
---
 .github/boring-cyborg.yml                                |  2 --
 BREEZE.rst                                               | 11 ++++++++---
 dev/breeze/src/airflow_breeze/utils/visuals.py           |  4 ++--
 docker_tests/docker_tests_utils.py                       |  4 ++--
 docs/README.rst                                          | 10 +++++-----
 .../howto/create-update-providers.rst                    |  4 ++--
 breeze => scripts/tools/setup_breeze                     | 16 ++++++++++------
 7 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/.github/boring-cyborg.yml b/.github/boring-cyborg.yml
index 1726b32a84..af84ccf76a 100644
--- a/.github/boring-cyborg.yml
+++ b/.github/boring-cyborg.yml
@@ -87,10 +87,8 @@ labelPRBasedOnFilePath:
     - scripts/**/*
     - dev/**/*
     - .github/**/*
-    - breeze
     - Dockerfile.ci
     - BREEZE.rst
-    - breeze-complete
     - CONTRIBUTING.*
     - LOCAL_VIRTUALENV.rst
     - STATIC_CODE_CHECKS.rst
diff --git a/BREEZE.rst b/BREEZE.rst
index 23fb349e96..43d26d0931 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -42,9 +42,8 @@ are described in `CONTRIBUTING.rst <CONTRIBUTING.rst#integration-test-developmen
   documentation mentions when ``./breeze-legacy`` is involved.
 
   The new ``breeze`` after installing is available on your PATH and you should launch it simply as
-  ``breeze <COMMAND> <FLAGS>``. Previously you had to prepend breeze with ``./`` but this is not needed
-  any more. For convenience, we will keep ``./breeze`` script for a while to run the new breeze and you
-  can still use the legacy Breeze with ``./breeze-legacy``.
+  ``breeze <COMMAND> <FLAGS>``. Previously you had to prepend breeze with ``./`` but this is removed now
+  You can still use the legacy Breeze with ``./breeze-legacy``.
 
 Watch the video below about Airflow Breeze. It explains the motivation for Breeze
 and screencast all its uses. The video describes old ``./breeze-legacy`` (in video it still
@@ -298,6 +297,12 @@ You should set up the autocomplete option automatically by running:
 
    breeze setup autocomplete
 
+Automating breeze installation
+------------------------------
+
+Breeze on POSIX-compliant systems (Linux, MacOS) can be automatically installed by running the
+``scripts/tools/setup_breeze`` bash script. This includes checking and installing ``pipx``, setting up
+``breeze`` with it and setting up autocomplete.
 
 Customizing your environment
 ----------------------------
diff --git a/dev/breeze/src/airflow_breeze/utils/visuals.py b/dev/breeze/src/airflow_breeze/utils/visuals.py
index 7702ed0390..2d20e5a297 100644
--- a/dev/breeze/src/airflow_breeze/utils/visuals.py
+++ b/dev/breeze/src/airflow_breeze/utils/visuals.py
@@ -117,7 +117,7 @@ CHEATSHEET = f"""
 
         [info]* Other options[/]
 
-        Check out `--help` for ./breeze commands. It will show you other options, such as running
+        Check out `--help` for `breeze` command. It will show you other options, such as running
         integration or starting complete Airflow using `start-airflow` command as well as ways
         of cleaning up the installation.
 
@@ -126,7 +126,7 @@ CHEATSHEET = f"""
 
         You can disable this cheatsheet by running:
 
-            ./breeze setup config --no-cheatsheet
+            breeze setup config --no-cheatsheet
 
 """
 CHEATSHEET_STYLE = "white"
diff --git a/docker_tests/docker_tests_utils.py b/docker_tests/docker_tests_utils.py
index 77960ebaeb..d902cadb1b 100644
--- a/docker_tests/docker_tests_utils.py
+++ b/docker_tests/docker_tests_utils.py
@@ -83,11 +83,11 @@ In case 2) - Follow the steps below:
 
 CI image:
 
-     ./breeze ci-image build --upgrade-to-newer-dependencies --python 3.7
+     breeze ci-image build --upgrade-to-newer-dependencies --python 3.7
 
 Production image:
 
-     ./breeze ci-image build --production-image --upgrade-to-newer-dependencies --python 3.7
+     breeze ci-image build --production-image --upgrade-to-newer-dependencies --python 3.7
 
 * You will see error messages there telling which requirements are conflicting and which packages caused the
   conflict. Add the limitation that caused the conflict to EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS
diff --git a/docs/README.rst b/docs/README.rst
index c91125b6bd..35fafc7405 100644
--- a/docs/README.rst
+++ b/docs/README.rst
@@ -39,31 +39,31 @@ You can only run one of the steps via ``--spellcheck-only`` or ``--docs-only``.
 
 .. code-block:: bash
 
-    ./breeze build-docs
+    breeze build-docs
 
 or just to run spell-check
 
 .. code-block:: bash
 
-     ./breeze build-docs --spellcheck-only
+     breeze build-docs --spellcheck-only
 
 or just to run documentation building
 
 .. code-block:: bash
 
-     ./breeze build-docs --docs-only
+     breeze build-docs --docs-only
 
 Also, you can only build one documentation via ``--package-filter``.
 
 .. code-block:: bash
 
-    ./breeze build-docs --package-filter <PACKAGE-NAME>
+    breeze build-docs --package-filter <PACKAGE-NAME>
 
 You can also see all the available arguments via ``--help``.
 
 .. code-block:: bash
 
-    ./breeze build-docs --help
+    breeze build-docs --help
 
 Running the Docs Locally
 ------------------------
diff --git a/docs/apache-airflow-providers/howto/create-update-providers.rst b/docs/apache-airflow-providers/howto/create-update-providers.rst
index 584cf3660b..ef4dd4b6f9 100644
--- a/docs/apache-airflow-providers/howto/create-update-providers.rst
+++ b/docs/apache-airflow-providers/howto/create-update-providers.rst
@@ -261,8 +261,8 @@ main Airflow documentation that involves some steps with the providers is also w
 
   .. code-block:: bash
 
-    ./breeze build-docs --package-filter apache-airflow-providers-<NEW_PROVIDER>
-    ./breeze build-docs --package-filter apache-airflow
+    breeze build-docs --package-filter apache-airflow-providers-<NEW_PROVIDER>
+    breeze build-docs --package-filter apache-airflow
 
 Optional provider features
 --------------------------
diff --git a/breeze b/scripts/tools/setup_breeze
similarity index 85%
rename from breeze
rename to scripts/tools/setup_breeze
index d01baefe43..b8ef210594 100755
--- a/breeze
+++ b/scripts/tools/setup_breeze
@@ -18,12 +18,14 @@
 set -euo pipefail
 
 MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+AIRFLOW_SOURCES=$(cd "${MY_DIR}/../.." && pwd)
 
 BREEZE_BINARY=breeze
 COLOR_RED=$'\e[31m'
+COLOR_GREEN=$'\e[32m'
+COLOR_YELLOW=$'\e[33m'
 COLOR_BLUE=$'\e[34m'
 COLOR_RESET=$'\e[0m'
-COLOR_YELLOW=$'\e[33m'
 
 function manual_instructions() {
     echo
@@ -31,7 +33,7 @@ function manual_instructions() {
     echo
     echo "    python -m pip install pipx"
     echo "    pipx ensurepath"
-    echo "    pipx install -e '${MY_DIR}/dev/breeze/'"
+    echo "    pipx install -e '${AIRFLOW_SOURCES}/dev/breeze/'"
     echo "    breeze setup autocomplete --force"
     echo
     echo "   After that, both pipx and breeze should be available on your path"
@@ -51,7 +53,7 @@ function check_breeze_installed() {
         if [[ ${pipx_on_path} != 0 ]]; then
             echo "${COLOR_RED}The 'pipx' is not on path. It should be installed and 'pipx' should be available on your PATH.${COLOR_RESET}"
             export TIMEOUT=0
-            if "${MY_DIR}/scripts/tools/confirm" "Installing pipx?"; then
+            if "${MY_DIR}/confirm" "Installing pipx?"; then
                 python -m pip install pipx --upgrade
                 echo
                 echo "${COLOR_YELLOW}Please close and re-open the shell and retry. You might need to add 'pipx' to the PATH!${COLOR_RESET}"
@@ -67,9 +69,9 @@ function check_breeze_installed() {
             echo
             echo "${COLOR_YELLOW}Installing Breeze. This will install breeze via pipx and modify your local rc file for ${SHELL}${COLOR_RESET}"
             echo
-            if "${MY_DIR}/scripts/tools/confirm" "installing and modifying the startup scripts"; then
+            if "${MY_DIR}/confirm" "installing and modifying the startup scripts"; then
                 pipx ensurepath --force
-                pipx install -e "${MY_DIR}/dev/breeze/" --force
+                pipx install -e "${AIRFLOW_SOURCES}/dev/breeze/" --force
                 ${BREEZE_BINARY} setup-autocomplete --force --answer yes
                 echo
                 echo "${COLOR_YELLOW}Please close and re-open the shell and retry. Then rerun your last command!${COLOR_RESET}"
@@ -84,4 +86,6 @@ function check_breeze_installed() {
 
 check_breeze_installed
 
-${BREEZE_BINARY} "${@}"
+echo
+echo "${COLOR_GREEN}Breeze is correctly installed! You can run it via 'breeze' command. Go ahead and develop Airflow.${COLOR_RESET}"
+echo