Skip to content

Commit 86f8899

Browse files
committed
Add bumpver configuration
This is directly called from ops/deploy, so usage of this tool is abstracted and not super important. It's easy to use however, and has a string input method, instead of incrementing each part individually, a la bump2version. ``` % bumpver update --dry --set-version "8.0.0" INFO - fetching tags from remote (to turn off use: -n / --no-fetch) INFO - Old Version: 7.4.2 INFO - New Version: 8.0.0 --- docs/conf.py +++ docs/conf.py @@ -67,7 +67,7 @@ copyright = '2010-{}, Read the Docs, Inc & contributors'.format( timezone.now().year ) -version = "7.4.2" +version = "8.0.0" release = version exclude_patterns = ['_build'] default_role = 'obj' --- package.json +++ package.json @@ -1,6 +1,6 @@ { "name": "readthedocs", - "version": "7.4.2", + "version": "8.0.0", "description": "Read the Docs build dependencies", "author": "Read the Docs, Inc <[email protected]>", "scripts": { --- readthedocs/__init__.py +++ readthedocs/__init__.py @@ -2,5 +2,5 @@ import os.path -__version__ = "7.4.2" +__version__ = "8.0.0" --- setup.cfg +++ setup.cfg @@ -29,7 +29,7 @@ github_repo = readthedocs.org [bumpver] -current_version = "7.4.2" +current_version = "8.0.0" version_pattern = "MAJOR.MINOR.PATCH[TAGNUM]" commit_message = "Bump version {old_version} -> {new_version}" commit = False ```
1 parent 20c2db1 commit 86f8899

File tree

4 files changed

+21
-26
lines changed

4 files changed

+21
-26
lines changed

docs/conf.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import os
1515
import sys
16-
from configparser import RawConfigParser
1716

1817
import sphinx_rtd_theme
1918

@@ -45,13 +44,6 @@
4544
locals()[k] = v
4645

4746

48-
def get_version():
49-
"""Return package version from setup.cfg."""
50-
config = RawConfigParser()
51-
config.read(os.path.join('..', 'setup.cfg'))
52-
return config.get('metadata', 'version')
53-
54-
5547
sys.path.append(os.path.abspath('_ext'))
5648
extensions = [
5749
'sphinx.ext.autosectionlabel',
@@ -75,7 +67,7 @@ def get_version():
7567
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
7668
timezone.now().year
7769
)
78-
version = get_version()
70+
version = "7.4.2"
7971
release = version
8072
exclude_patterns = ['_build']
8173
default_role = 'obj'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "readthedocs",
3-
"version": "7.4.1",
3+
"version": "7.4.2",
44
"description": "Read the Docs build dependencies",
5-
"author": "Anthony Johnson <anthony@readthedocs.com>",
5+
"author": "Read the Docs, Inc <support@readthedocs.com>",
66
"scripts": {
77
"build": "gulp build",
88
"dev": "gulp dev",

readthedocs/__init__.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,4 @@
22

33
import os.path
44

5-
from configparser import RawConfigParser
6-
7-
8-
def get_version(setupcfg_path):
9-
"""Return package version from setup.cfg."""
10-
config = RawConfigParser()
11-
config.read(setupcfg_path)
12-
return config.get('metadata', 'version')
13-
14-
15-
__version__ = get_version(
16-
os.path.abspath(
17-
os.path.join(os.path.dirname(__file__), '..', 'setup.cfg'),
18-
),
19-
)
5+
__version__ = "7.4.2"

setup.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,20 @@ zip_safe = False
2828
github_owner = readthedocs
2929
github_repo = readthedocs.org
3030

31+
[bumpver]
32+
current_version = "7.4.2"
33+
version_pattern = "MAJOR.MINOR.PATCH[TAGNUM]"
34+
commit_message = "Bump version {old_version} -> {new_version}"
35+
commit = False
36+
tag = False
37+
push = False
38+
39+
[bumpver:file_patterns]
40+
setup.cfg =
41+
version = "{version}"
42+
package.json =
43+
"version": "{version}",
44+
docs/conf.py =
45+
version = "{version}"
46+
readthedocs/__init__.py =
47+
__version__ = "{version}"

0 commit comments

Comments
 (0)