2016-12-23 21:30:16 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
|
|
import os.path
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2018-05-30 16:54:45 +00:00
|
|
|
version_file = os.path.join(
|
|
|
|
os.path.dirname(os.path.dirname(__file__)), 'uvloop', '__init__.py')
|
2016-12-23 21:30:16 +00:00
|
|
|
|
2018-05-30 16:54:45 +00:00
|
|
|
with open(version_file, 'r') as f:
|
2016-12-23 21:30:16 +00:00
|
|
|
for line in f:
|
2018-05-30 16:54:45 +00:00
|
|
|
if line.startswith('__version__ ='):
|
2016-12-23 21:30:16 +00:00
|
|
|
_, _, version = line.partition('=')
|
|
|
|
print(version.strip(" \n'\""))
|
|
|
|
return 0
|
|
|
|
|
2018-05-30 16:54:45 +00:00
|
|
|
print('could not find package version in uvloop/__init__.py',
|
|
|
|
file=sys.stderr)
|
2016-12-23 21:30:16 +00:00
|
|
|
return 1
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|