Skip to content

Commit 007f542

Browse files
authored
Add bumpver configuration (#9029)
* 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 ``` * Make lint happy? * Nope. Make lint happy? * Better isort hack
1 parent 20c2db1 commit 007f542

File tree

5 files changed

+36
-41
lines changed

5 files changed

+36
-41
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ private_*
5454
readthedocs/htmlcov
5555
tags
5656
.python-version
57+
.tool-versions
5758
*.pyo
5859
.pytest_cache/
5960
scripts/travis/elasticsearch*
@@ -66,6 +67,8 @@ venv/
6667
ENV/
6768
env.bak/
6869
venv.bak/
70+
.direnv/
71+
.envrc
6972

7073
dev.db-journal
7174
/readthedocs/settings/build_docker.py

docs/conf.py

+12-22
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@
1313

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

1817
import sphinx_rtd_theme
1918

2019
sys.path.insert(0, os.path.abspath('..'))
2120
sys.path.append(os.path.dirname(__file__))
2221
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readthedocs.settings.dev")
2322

24-
from django.utils import timezone
25-
23+
# Load Django after sys.path and configuration setup
24+
# isort: split
2625
import django
27-
django.setup()
2826

27+
django.setup()
2928

3029
# Set here the variables you want for each docset.
3130
docsets = {
@@ -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',
@@ -71,11 +63,9 @@ def get_version():
7163

7264
templates_path = ['_templates']
7365

74-
master_doc = 'index'
75-
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
76-
timezone.now().year
77-
)
78-
version = get_version()
66+
master_doc = "index"
67+
copyright = "2010, Read the Docs, Inc & contributors"
68+
version = "7.4.2"
7969
release = version
8070
exclude_patterns = ['_build']
8171
default_role = 'obj'
@@ -103,12 +93,12 @@ def get_version():
10393
"deflist",
10494
]
10595
hoverxref_intersphinx = [
106-
"sphinx",
107-
"pip",
108-
"nbsphinx",
109-
"myst-nb",
110-
"ipywidgets",
111-
"jupytext",
96+
"sphinx",
97+
"pip",
98+
"nbsphinx",
99+
"myst-nb",
100+
"ipywidgets",
101+
"jupytext",
112102
]
113103
htmlhelp_basename = 'ReadTheDocsdoc'
114104
latex_documents = [

package.json

+2-2
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

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
"""Read the Docs."""
22

3-
import os.path
43

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-
)
4+
__version__ = "7.4.2"

setup.cfg

+18-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description = Read the Docs builds and hosts documentation
66
author = Read the Docs, Inc
77
author_email = [email protected]
88
url = http://readthedocs.org
9-
classifiers =
9+
classifiers =
1010
Development Status :: 5 - Production/Stable
1111
Environment :: Web Environment
1212
Intended Audience :: Developers
@@ -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)