From 6bdb91aefc6acb9b0065c7edae19887778dedb22 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Wed, 30 May 2018 12:54:45 -0400 Subject: [PATCH] Fix ci / package_version.py script to support __version__ --- .ci/package-version.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.ci/package-version.py b/.ci/package-version.py index fbae1f3..83effeb 100755 --- a/.ci/package-version.py +++ b/.ci/package-version.py @@ -6,17 +6,18 @@ import sys def main(): - setup_py = os.path.join(os.path.dirname(os.path.dirname(__file__)), - 'setup.py') + version_file = os.path.join( + os.path.dirname(os.path.dirname(__file__)), 'uvloop', '__init__.py') - with open(setup_py, 'r') as f: + with open(version_file, 'r') as f: for line in f: - if line.startswith('VERSION ='): + if line.startswith('__version__ ='): _, _, version = line.partition('=') print(version.strip(" \n'\"")) return 0 - print('could not find package version in setup.py', file=sys.stderr) + print('could not find package version in uvloop/__init__.py', + file=sys.stderr) return 1