Skip to content

Commit b2a28d1

Browse files
authored
Moves provider packages scripts to dev (#12082)
The change #10806 made airflow works with implicit packages when "airflow" got imported. This is a good change, however it has some unforeseen consequences. The 'provider_packages' script copy all the providers code for backports in order to refactor them to the empty "airflow" directory in provider_packages folder. The #10806 change turned that empty folder in 'airflow' package because it was in the same directory as the provider_packages scripts. Moving the scripts to dev solves this problem.
1 parent eaac361 commit b2a28d1

File tree

159 files changed

+533
-9319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+533
-9319
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,10 @@ jobs:
378378
runs-on: ubuntu-latest
379379
needs: [build-info, ci-images]
380380
env:
381-
INSTALL_AIRFLOW_VERSION: "2.0.0-dev" # Note that this causes local installation
381+
INSTALL_AIRFLOW_VERSION: "wheel"
382382
PYTHON_MAJOR_MINOR_VERSION: ${{needs.build-info.outputs.defaultPythonVersion}}
383-
VERSION_SUFFIX_FOR_PYPI: "a0"
384-
VERSION_SUFFIX_FOR_SVN: "a0"
383+
VERSION_SUFFIX_FOR_PYPI: "a2"
384+
VERSION_SUFFIX_FOR_SVN: "a2"
385385
if: needs.build-info.outputs.image-build == 'true'
386386
steps:
387387
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ dmypy.json
186186
/.kube
187187
/.inputrc
188188
log.txt*
189+
190+
# Provider-related ignores
189191
/provider_packages/CHANGELOG.txt
192+
/airflow/providers/__init__.py
190193

191194
# Local .terraform directories
192195
**/.terraform/*

.pre-commit-config.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ repos:
199199
hooks:
200200
- id: isort
201201
name: Run isort to sort imports
202-
types: [python]
202+
files: \.py$
203203
# To keep consistent with the global isort skip config defined in setup.cfg
204204
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
205205
- repo: https://github.com/pycqa/pydocstyle
@@ -335,7 +335,7 @@ repos:
335335
^airflow/operators/.*$|
336336
^airflow/sensors/.*$|
337337
^airflow/providers/.*$|
338-
^provider_packages/.*$
338+
^dev/provider_packages/.*$
339339
- id: base-operator
340340
language: pygrep
341341
name: Make sure BaseOperator[Link] is imported from airflow.models outside of core
@@ -438,6 +438,17 @@ repos:
438438
files: ^airflow/www/.*\.(css|scss|sass)$
439439
# Keep dependency versions in sync w/ airflow/www/package.json
440440
additional_dependencies: ['[email protected]', '[email protected]']
441+
- id: version-sync
442+
name: Version sync
443+
files: ^airflow/version.py$|setup.py
444+
entry: ./scripts/ci/pre_commit/pre_commit_sync_version.sh
445+
language: system
446+
- id: providers-init-file
447+
name: Provider init file
448+
pass_filenames: false
449+
always_run: true
450+
entry: ./scripts/ci/pre_commit/pre_commit_check_providers_init.sh
451+
language: system
441452
- id: mermaid
442453
name: Generate mermaid images
443454
entry: ./scripts/ci/pre_commit/pre_commit_mermaid.sh

BREEZE.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,9 @@ This is the current syntax for `./breeze <./breeze>`_:
12071207
image building time in production image and at container entering time for CI image. One of:
12081208
12091209
1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2
1210+
wheel
1211+
1212+
When 'wheel' is used, Airflow is installed from /dist/apache_airflow-*.whl file.
12101213
12111214
-t, --install-airflow-reference INSTALL_AIRFLOW_REFERENCE
12121215
If specified, installs Airflow directly from reference in GitHub. This happens at
@@ -2004,11 +2007,11 @@ This is the current syntax for `./breeze <./breeze>`_:
20042007
dont-use-safe-filter end-of-file-fixer fix-encoding-pragma flake8 forbid-tabs
20052008
helm-lint incorrect-use-of-LoggingMixin insert-license isort language-matters
20062009
lint-dockerfile lint-openapi mermaid mixed-line-ending mypy mypy-helm
2007-
no-relative-imports pre-commit-descriptions provide-create-sessions pydevd
2008-
pydocstyle pylint pylint-tests python-no-log-warn pyupgrade restrict-start_date
2009-
rst-backticks setup-order setup-installation shellcheck sort-in-the-wild stylelint
2010-
trailing-whitespace update-breeze-file update-extras update-local-yml-file
2011-
update-setup-cfg-file yamllint
2010+
no-relative-imports pre-commit-descriptions provide-create-sessions
2011+
providers-init-file pydevd pydocstyle pylint pylint-tests python-no-log-warn
2012+
pyupgrade restrict-start_date rst-backticks setup-order setup-installation
2013+
shellcheck sort-in-the-wild stylelint trailing-whitespace update-breeze-file
2014+
update-extras update-local-yml-file update-setup-cfg-file version-sync yamllint
20122015
20132016
You can pass extra arguments including options to to the pre-commit framework as
20142017
<EXTRA_ARGS> passed after --. For example:
@@ -2231,6 +2234,9 @@ This is the current syntax for `./breeze <./breeze>`_:
22312234
image building time in production image and at container entering time for CI image. One of:
22322235
22332236
1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2
2237+
wheel
2238+
2239+
When 'wheel' is used, Airflow is installed from /dist/apache_airflow-*.whl file.
22342240
22352241
-t, --install-airflow-reference INSTALL_AIRFLOW_REFERENCE
22362242
If specified, installs Airflow directly from reference in GitHub. This happens at

CI.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ You can use those variables when you try to reproduce the build locally.
203203
| Image variables |
204204
+-----------------------------------------+-------------+-------------+------------+-------------------------------------------------+
205205
| ``INSTALL_AIRFLOW_VERSION`` | | | | Installs Airflow version from PyPI when |
206-
| | | | | building image. |
206+
| | | | | building image. Can be "wheel" to install from |
207+
| | | | | the wheel package instead. |
207208
+-----------------------------------------+-------------+-------------+------------+-------------------------------------------------+
208209
| ``INSTALL_AIRFLOW_REFERENCE`` | | | | Installs Airflow version from GitHub |
209210
| | | | | branch or tag. |

STATIC_CODE_CHECKS.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ require Breeze Docker images to be installed locally:
126126
----------------------------------- ---------------------------------------------------------------- ------------
127127
``provide-create-sessions`` Make sure provide-session and create-session imports are OK.
128128
----------------------------------- ---------------------------------------------------------------- ------------
129+
``providers-init-file`` Check that provider's __init__.py file is removed
130+
----------------------------------- ---------------------------------------------------------------- ------------
129131
``pydevd`` Check for accidentally committed pydevd statements.
130132
----------------------------------- ---------------------------------------------------------------- ------------
131133
``pydocstyle`` Runs pydocstyle.
@@ -156,10 +158,12 @@ require Breeze Docker images to be installed locally:
156158
----------------------------------- ---------------------------------------------------------------- ------------
157159
``update-local-yml-file`` Updates mounts in local.yml file.
158160
----------------------------------- ---------------------------------------------------------------- ------------
159-
``update-setup-cfg-file`` Update setup.cfg file with all licenses.
161+
``update-setup-cfg-file`` Update setup.cfg file with all licenses.
160162
----------------------------------- ---------------------------------------------------------------- ------------
161163
``update-extras`` Updates extras in the documentation.
162164
----------------------------------- ---------------------------------------------------------------- ------------
165+
``version-sync`` Synchronizes versions setup.py <-> airflow/version.py.
166+
----------------------------------- ---------------------------------------------------------------- ------------
163167
``yamllint`` Checks yaml files with yamllint.
164168
=================================== ================================================================ ============
165169

airflow/api_connexion/exceptions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121

2222
from airflow import version
2323

24-
doc_link = f'https://airflow.apache.org/docs/{version.version}/stable-rest-api-ref.html'
25-
if 'dev' in version.version:
24+
if any(suffix in version.version for suffix in ['dev', 'a', 'b']):
2625
doc_link = "https://airflow.readthedocs.io/en/latest/stable-rest-api-ref.html"
26+
else:
27+
doc_link = f'https://airflow.apache.org/docs/{version.version}/stable-rest-api-ref.html'
2728

2829
EXCEPTIONS_LINK_MAP = {
2930
400: f"{doc_link}#section/Errors/BadRequest",
@@ -38,6 +39,7 @@
3839
def common_error_handler(exception):
3940
"""
4041
Used to capture connexion exceptions and add link to the type field
42+
4143
:type exception: Exception
4244
"""
4345
if isinstance(exception, ProblemException):

airflow/providers/amazon/backport_provider_setup.cfg

Lines changed: 0 additions & 51 deletions
This file was deleted.

airflow/providers/amazon/backport_provider_setup.py

Lines changed: 0 additions & 112 deletions
This file was deleted.

airflow/providers/apache/cassandra/backport_provider_setup.cfg

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)