Skip to content

Commit 956a266

Browse files
committed
Updated version to 0.5.4
1 parent a6c927e commit 956a266

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

pythonforandroid/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
__version__ = '0.5.2'
2+
__version__ = '0.5.4'

setup.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from os.path import join, dirname, sep
55
import os
66
import glob
7+
import re
78

89
# NOTE: All package data should also be set in MANIFEST.in
910

@@ -56,8 +57,26 @@ def recursively_include(results, directory, patterns):
5657
with open(join(dirname(__file__), 'README.rst')) as fileh:
5758
long_description = fileh.read()
5859

60+
init_filen = join(dirname(__file__), 'pythonforandroid', '__init__.py')
61+
version = None
62+
try:
63+
with open(init_filen) as fileh:
64+
lines = fileh.readlines()
65+
except IOError:
66+
pass
67+
else:
68+
for line in lines:
69+
line = line.strip()
70+
if line.startswith('__version__ = '):
71+
matches = re.findall(r'["\'].+["\']', line)
72+
if matches:
73+
version = matches[0].strip("'").strip('"')
74+
break
75+
if version is None:
76+
raise Exception('Error: version could not be loaded from {}'.format(init_filen))
77+
5978
setup(name='python-for-android',
60-
version='0.5.2',
79+
version=version,
6180
description='Android APK packager for Python scripts and apps',
6281
long_description=long_description,
6382
author='The Kivy team',

0 commit comments

Comments
 (0)