Repository: apache/airflow

Issue:
Building backport packages can be done inside Breeze container
**Description**

Currently, backport packages are built on the host, but we might easily switch to building them in the container. 

What would be needed:

- [ ] Change the script to run using docker run and breeze image rather than locally (Similarly to docs build or generate-requirements)
- [ ] Make sure MOUNT_SOURCE_DIR_FOR_STATIC_CHECKS is set to "true" and exported to mount all sources to inside the container
- [ ] Make sure the packages are generated in /dist folder rather than in ${AIRFLOW_SOURCES}/dist (local dist folder should be mapped there - check that indeed it is mapped when MOUNT_SOURCE_DIR_FOR_STATIC_CHECKS is "true"
- [ ] Make sure `bowler`, `wheel`, `sdist` is part of the pip-installed dependencies in the container 

**Use case / motivation**

It's not obvious that you need some requirements (bowler, wheel, sdist) and it would be great if you do not have to set up your local virtualenv with it to make it runs.

CC: @feluelle @turbaszek 



Discussion:

Resolving patch:
diff --git a/backport_packages/setup_backport_packages.py b/backport_packages/setup_backport_packages.py
--- a/backport_packages/setup_backport_packages.py
+++ b/backport_packages/setup_backport_packages.py
@@ -346,7 +346,7 @@ def do_setup_package_providers(provider_package: str, deps: List[str], extras: D
         long_description=get_long_description(provider_package),
         long_description_content_type='text/markdown',
         license='Apache License 2.0',
-        version='0.0.1',
+        version='2020.04.27.rc1',
         packages=found_packages,
         package_data={
             '': ["airflow/providers/cncf/kubernetes/example_dags/*.yaml"],
@@ -366,6 +366,13 @@ def do_setup_package_providers(provider_package: str, deps: List[str], extras: D
             'Programming Language :: Python :: 3.7',
             'Topic :: System :: Monitoring',
         ],
+        setup_requires=[
+            'bowler',
+            'docutils',
+            'gitpython',
+            'setuptools',
+            'wheel',
+        ],
         python_requires='>=3.6',
     )
 
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -427,13 +427,16 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version
 ############################################################################################################
 devel = [
     'beautifulsoup4~=4.7.1',
+    'bowler',
     'click==6.7',
     'contextdecorator;python_version<"3.4"',
     'coverage',
+    'docutils',
     'flake8>=3.6.0',
     'flake8-colors',
     'flaky',
     'freezegun',
+    'gitpython',
     'ipdb',
     'jira',
     'mongomock',
@@ -452,6 +455,8 @@ def write_version(filename: str = os.path.join(*[my_dir, "airflow", "git_version
     'pywinrm',
     'qds-sdk>=1.9.6',
     'requests_mock',
+    'setuptools',
+    'wheel',
     'yamllint',
 ]
 ############################################################################################################
@@ -637,8 +642,8 @@ def do_setup():
         install_requires=INSTALL_REQUIREMENTS,
         setup_requires=[
             'bowler',
-            'docutils>=0.14, <0.16'
-            'gitpython>=2.0.2',
+            'docutils',
+            'gitpython',
             'setuptools',
             'wheel',
         ],


Test patch: