Skip to content

Add bumpver configuration #9029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ private_*
readthedocs/htmlcov
tags
.python-version
.tool-versions
*.pyo
.pytest_cache/
scripts/travis/elasticsearch*
Expand All @@ -66,6 +67,8 @@ venv/
ENV/
env.bak/
venv.bak/
.direnv/
.envrc

dev.db-journal
/readthedocs/settings/build_docker.py
Expand Down
40 changes: 17 additions & 23 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@

import os
import sys
from configparser import RawConfigParser

import sphinx_rtd_theme

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

from django.utils import timezone

import django
django.setup()
try:
# Nesting in try to avoid isort inflicting unwanted changes. It tries to
# move these imports above the very necessary sys.path manipulation.
import django
from django.utils import timezone

django.setup()
except ImportError:
raise

# Set here the variables you want for each docset.
docsets = {
Expand All @@ -45,13 +48,6 @@
locals()[k] = v


def get_version():
"""Return package version from setup.cfg."""
config = RawConfigParser()
config.read(os.path.join('..', 'setup.cfg'))
return config.get('metadata', 'version')


sys.path.append(os.path.abspath('_ext'))
extensions = [
'sphinx.ext.autosectionlabel',
Expand All @@ -71,11 +67,9 @@ def get_version():

templates_path = ['_templates']

master_doc = 'index'
copyright = '2010-{}, Read the Docs, Inc & contributors'.format(
timezone.now().year
)
version = get_version()
master_doc = "index"
copyright = "2010-{}, Read the Docs, Inc & contributors".format(timezone.now().year)
version = "7.4.2"
release = version
exclude_patterns = ['_build']
default_role = 'obj'
Expand Down Expand Up @@ -103,12 +97,12 @@ def get_version():
"deflist",
]
hoverxref_intersphinx = [
"sphinx",
"pip",
"nbsphinx",
"myst-nb",
"ipywidgets",
"jupytext",
"sphinx",
"pip",
"nbsphinx",
"myst-nb",
"ipywidgets",
"jupytext",
]
htmlhelp_basename = 'ReadTheDocsdoc'
latex_documents = [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "readthedocs",
"version": "7.4.1",
"version": "7.4.2",
"description": "Read the Docs build dependencies",
"author": "Anthony Johnson <anthony@readthedocs.com>",
"author": "Read the Docs, Inc <support@readthedocs.com>",
"scripts": {
"build": "gulp build",
"dev": "gulp dev",
Expand Down
17 changes: 1 addition & 16 deletions readthedocs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
"""Read the Docs."""

import os.path

from configparser import RawConfigParser


def get_version(setupcfg_path):
"""Return package version from setup.cfg."""
config = RawConfigParser()
config.read(setupcfg_path)
return config.get('metadata', 'version')


__version__ = get_version(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'setup.cfg'),
),
)
__version__ = "7.4.2"
19 changes: 18 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = Read the Docs builds and hosts documentation
author = Read the Docs, Inc
author_email = [email protected]
url = http://readthedocs.org
classifiers =
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Intended Audience :: Developers
Expand All @@ -28,3 +28,20 @@ zip_safe = False
github_owner = readthedocs
github_repo = readthedocs.org

[bumpver]
current_version = "7.4.2"
version_pattern = "MAJOR.MINOR.PATCH[TAGNUM]"
commit_message = "Bump version {old_version} -> {new_version}"
commit = False
tag = False
push = False

[bumpver:file_patterns]
setup.cfg =
version = "{version}"
package.json =
"version": "{version}",
docs/conf.py =
version = "{version}"
readthedocs/__init__.py =
__version__ = "{version}"