Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions sdks/python/apache_beam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,3 @@
from apache_beam.pipeline import Pipeline
from apache_beam.transforms import *
# pylint: enable=wrong-import-position

__version__ = version.get_version()
3 changes: 2 additions & 1 deletion sdks/python/apache_beam/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""Apache Beam SDK version information and utilities."""


import os
import re


Expand All @@ -33,7 +34,7 @@ def get_version():

# Read the version from pom.xml file
def get_version_from_pom():
with open('pom.xml', 'r') as f:
with open(os.path.join(os.path.dirname(__file__), '..', 'pom.xml'), 'r') as f:
pom = f.read()
regex = (r'.*<parent>\s*'
r'<groupId>[a-z\.]+</groupId>\s*'
Expand Down
4 changes: 3 additions & 1 deletion sdks/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@


def get_version():
global_names = {'__name__': '__main__'}
global_names = {
'__name__': '__main__',
'__file__': os.path.abspath('./apache_beam/version.py')}
exec(open(os.path.normpath('./apache_beam/version.py')).read(), global_names)
return global_names['__version__']

Expand Down