Skip to content

Commit a7e02d1

Browse files
committed
and one more doctest for all
1 parent 500270f commit a7e02d1

File tree

11 files changed

+135
-11
lines changed

11 files changed

+135
-11
lines changed

base/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

git/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

gitflow/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

githooks/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

hooks-demo/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

meta/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

pythonic/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

release/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

stages/versioning.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
@@ -138,6 +142,13 @@ def run(self):
138142
print('== Version-Info:\n%s' % pformat(version_in_git.VERSION_INFO))
139143

140144
def bump_version(info):
145+
""" Bump a parsed version.
146+
147+
>>> bump_version({'release':(8, 1)})
148+
{'release': (8, 2)}
149+
>>> bump_version({'release':(8, 1), 'post_release':0})['post_release']
150+
1
151+
"""
141152
if 'dev_release' in info:
142153
info['dev_release'] += 1
143154
elif 'post_release' in info:
@@ -194,6 +205,7 @@ def run(self):
194205
print('== Tagging: %s' % tag)
195206
os.system('git tag ' + tag)
196207

208+
197209
class cmd_update_versionfile(Command):
198210
description = "update the versioning"
199211
user_options = []

versioning/flowtool_versioning/dropins/cmdclass.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def find_parent_containing(name, path=None, check='exists'):
5353
return find_parent_containing(name, path=alternative, check=check)
5454

5555
def read_config(filename):
56-
"""Read the project setup.cfg file to determine versioning config."""
56+
""" Read the project setup.cfg file to determine versioning config.
57+
58+
>>> hasattr(read_config(''), 'get')
59+
True
60+
"""
5761
# This might raise EnvironmentError (if setup.cfg is missing), or
5862
# configparser.NoSectionError (if it lacks a [versioneer] section), or
5963
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at

0 commit comments

Comments
 (0)