Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get airflow version from importlib.metadata rather than hard-coding #12786

Merged
merged 3 commits into from Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Expand Up @@ -440,11 +440,6 @@ repos:
files: ^airflow/www/.*\.(css|scss|sass)$
# Keep dependency versions in sync w/ airflow/www/package.json
additional_dependencies: ['stylelint@13.3.1', 'stylelint-config-standard@20.0.0']
- id: version-sync
name: Version sync
files: ^airflow/version.py$|setup.py
entry: ./scripts/ci/pre_commit/pre_commit_sync_version.sh
language: system
- id: providers-init-file
name: Provider init file
pass_filenames: false
Expand Down
11 changes: 10 additions & 1 deletion airflow/version.py
Expand Up @@ -17,4 +17,13 @@
# under the License.
#

version = '2.0.0b3'
__all__ = ['version']

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata

version = metadata.version('apache-airflow')

del metadata
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This line isn't strictly needed, it was just so that the only symbol in this module was version. For no god reason really)

29 changes: 0 additions & 29 deletions scripts/ci/pre_commit/pre_commit_sync_version.sh

This file was deleted.