jenkins-bot merged this change.
[doc] Update docs for setup.py
- remove pwb version on top to prevents to change
this doc with every release
- additional doc for get_version function
- only split the first space in git log entry for date sting
Change-Id: Iba895d86d6ced89d40ae0a77d5cfe8cd06aa93ec
---
M setup.py
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/setup.py b/setup.py
index 69e12d7..aadfda7 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-"""Installer script for Pywikibot 3.0 framework."""
+"""Installer script for Pywikibot framework."""
#
# (C) Pywikibot team, 2009-2020
#
@@ -165,13 +165,20 @@
def get_version(name):
- """Get a valid pywikibot module version string."""
+ """Get a valid pywikibot module version string.
+
+ Either create a timebased version number for the package
+ or read the version number from the package.
+
+ @return: pywikibot module version string
+ @rtype: str
+ """
version = '3.0'
try:
import subprocess
date = subprocess.check_output(
['git', 'log', '-1', '--format=%ci']).strip()
- date = date.decode().split(' ')[0].replace('-', '')
+ date = date.decode().split(' ', 1)[0].replace('-', '')
version += '.' + date
if 'sdist' not in sys.argv:
version += '.dev0'
To view, visit change 563400. To unsubscribe, or for help writing mail filters, visit settings.