jenkins-bot merged this change.
[IMPR] tests should always use a developent release
travis and appveyor uses setup.py to setup the tests environment.
Their version number should create an developmental release
Change-Id: Iffbb36bc43231afbc8502abccfe121b1c63d16ec
---
M setup.py
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/setup.py b/setup.py
index 8fa9f64..9a27c84 100644
--- a/setup.py
+++ b/setup.py
@@ -167,17 +167,22 @@
else:
test_deps += ['six']
-name = 'pywikibot'
-version = '3.0'
-try:
- import subprocess
- date = subprocess.check_output(['git', 'log', '-1', '--format=%ci']).strip()
- date = date.decode().split(' ')[0].replace('-', '')
- version = version + "." + date
-except Exception as e:
- print(e)
- version = version + "-dev"
+def get_version():
+ """Get a valid pywikibot module version string."""
+ version = '3.0'
+ try:
+ import subprocess
+ date = subprocess.check_output(
+ ['git', 'log', '-1', '--format=%ci']).strip()
+ date = date.decode().split(' ')[0].replace('-', '')
+ version += '.' + date
+ if 'sdist' not in sys.argv:
+ version += '.dev0'
+ except Exception as e:
+ print(e)
+ version += '.dev0'
+ return version
def read_desc(filename):
@@ -201,9 +206,10 @@
return ''.join(desc)
+name = 'pywikibot'
setup(
name=name,
- version=version,
+ version=get_version(),
description='Python MediaWiki Bot Framework',
long_description=read_desc('README.rst'),
keywords=('API', 'bot', 'framework', 'mediawiki', 'pwb', 'python',
To view, visit change 431317. To unsubscribe, visit settings.