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

kaxilnaik pushed a commit to branch show-airflow-version
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 335fd7c7b721d7b0880c70864a788400405103af
Author: Kaxil Naik <[email protected]>
AuthorDate: Tue Dec 8 20:31:41 2020 +0000

    Add Version command for Upgrade Check
---
 airflow/upgrade/checker.py |  5 +++++
 airflow/upgrade/setup.cfg  |  2 +-
 airflow/upgrade/version.py | 18 ++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/airflow/upgrade/checker.py b/airflow/upgrade/checker.py
index 363ab5e..40ba162 100644
--- a/airflow/upgrade/checker.py
+++ b/airflow/upgrade/checker.py
@@ -25,6 +25,7 @@ from airflow.upgrade.formatters import BaseFormatter
 from airflow.upgrade.problem import RuleStatus
 from airflow.upgrade.rules import get_rules
 from airflow.upgrade.rules.base_rule import BaseRule
+from airflow.upgrade.version import version as auc_version
 
 ALL_RULES = [cls() for cls in get_rules()]  # type: List[BaseRule]
 
@@ -58,6 +59,10 @@ def register_arguments(subparser):
     subparser.set_defaults(func=run)
 
 
+def version(args):  # noqa
+    print(auc_version)
+
+
 def run(args):
     from airflow.upgrade.formatters import (ConsoleFormatter, JSONFormatter)
     from airflow.upgrade.config import UpgradeConfig
diff --git a/airflow/upgrade/setup.cfg b/airflow/upgrade/setup.cfg
index ddd708c..7cf09fb 100644
--- a/airflow/upgrade/setup.cfg
+++ b/airflow/upgrade/setup.cfg
@@ -16,7 +16,7 @@
 # under the License.
 
 [metadata]
-version=1.0.0
+version=attr: version.version
 name = apache-airflow-upgrade-check
 description = Check for compatibility between Airflow versions
 long_description = file: airflow/upgrade/README.md
diff --git a/airflow/upgrade/version.py b/airflow/upgrade/version.py
new file mode 100644
index 0000000..e8ed750
--- /dev/null
+++ b/airflow/upgrade/version.py
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+version = "1.0.0"

Reply via email to