Skip to content

Commit

Permalink
use sensible dev versions
Browse files Browse the repository at this point in the history
  • Loading branch information
eteq committed Nov 17, 2017
1 parent 3d32db3 commit ee479d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
23 changes: 18 additions & 5 deletions tutorials/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Astropy documentation build configuration file.

import datetime
import re
import os
import sys
from os import path

# Building from inside the tutorials/ directory? Need to add correct helpers to the python path
a_h_path = None
Expand All @@ -17,6 +17,8 @@

# Load all of the global Astropy configuration
try:
# at some point hopefully this can be replaced with installing a
# standalone sphinx-astropy-theme
from astropy_helpers.sphinx.conf import *

import astropy_helpers
Expand All @@ -42,6 +44,7 @@
conf.read([os.path.join(os.path.dirname(__file__), '..', 'metadata.cfg')])
setup_cfg = dict(conf.items('metadata'))


# -- General configuration ----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -72,11 +75,21 @@
# |version| and |release|, also used in various other places throughout the
# built documents.

# The short X.Y version.
version = setup_cfg['version'].split('-', 1)[0]
# The full version, including alpha/beta/rc tags.
# release = package.__version__
release = version
release = setup_cfg['version']
# The short X.Y version.
version = re.match(r'([\d\.]*)(\D*\d?)', setup_cfg['version']).group(1)
if version.endswith('.'): # e.g. "3.0.dev", which splits into groups "3.0." and "dev"
version = version[:-1]


if release.endswith('dev'):
# once the sphinx-astropy-theme is ready, just copy over the git_helpers.py file
# into this repo - it has been long-term stable so the helpers aren't needed
# just for this.
from astropy_helpers.git_helpers import get_git_devstr
release = release + get_git_devstr(path=os.path.join(os.path.split(__file__)[0],'..'))



# -- Options for HTML output --------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion tutorials/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ and ``pip-requirements.txt`` for pip).

To actually update the version, modify the ``metadata.cfg`` at the root of this
repository with the new version. This is the version number that will be
shown in the sphinx builds.
shown in the sphinx builds. Note that if it ends in ``.dev``, this will be
followed by a revision number that is determined by the number of git commits.

Marking a cell with an intentional error
----------------------------------------
Expand Down

0 comments on commit ee479d0

Please sign in to comment.