Skip to content

Commit 08af83d

Browse files
committed
Switch to more DRYish version numbering
1 parent 6636eec commit 08af83d

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

patsy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import sys
1010

11-
__version__ = "0.2.1+dev"
11+
from patsy.version import __version__
1212

1313
# Do this first, to make it easy to check for warnings while testing:
1414
import os

patsy/version.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is part of Patsy
2+
# Copyright (C) 2011-2014 Nathaniel Smith <[email protected]>
3+
# See file LICENSE.txt for license information.
4+
5+
# This file must be kept very simple, because it is consumed from several
6+
# places -- it is imported by patsy/__init__.py, execfile'd by setup.py, etc.
7+
8+
# We use a simple scheme:
9+
# 1.0.0 -> 1.0.0-dev -> 1.1.0 -> 1.1.0-dev
10+
# where the -dev versions are never released into the wild, they're just what
11+
# we stick into the VCS in between releases.
12+
#
13+
# This is compatible with PEP 440:
14+
# http://legacy.python.org/dev/peps/pep-0440/
15+
# in a slightly abusive way -- PEP 440 provides no guidance on what version
16+
# number to use for *unreleased* versions, so we use an "integrator suffix",
17+
# which is intended to be used for things like Debian's locally patched
18+
# version, and is not allowed on public index servers. Which sounds about
19+
# right, actually... Crucially, PEP 440 says that "foo-bar" sorts *after*
20+
# "foo", which is what we want for a dev version. (Compare to "foo.dev0",
21+
# which sorts *before* "foo".)
22+
23+
__version__ = "0.2.1-dev"

release-checklist.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
* verify that the ">97% coverage" claim in overview.rst is still true.
66
* cd docs; make html -- check that there are no warnings
77
* check MANIFEST.in
8-
* update version in doc/changes.rst, setup.py, patsy/__init__.py
8+
* update version in doc/changes.rst, patsy/version.py
99
* make sure there are no uncommitted changes
1010
* clone a clean source directory (so as to get a clean checkout
1111
without killing the expensive-to-recreate .tox dir)
1212
* python sdist --formats=zip
1313
* unzip sdist to a clean directory, and run tox in it
1414
* in original directory: git tag <version> && git push --tags
15-
* in clean clone: python sdist --formats=zip,gztar upload
15+
* in clean clone: python sdist --formats=zip
16+
* twine upload dist/*.zip
1617
* Go to http://readthedocs.org/dashboard/patsy/versions/, set the new
1718
version to build and update the default.
1819
* announce release on:
1920
2021
2122
scipy-dev?
2223
pypi
23-
* update version in setup.py, patsy/__init__.py again (add "+dev")
24+
* update version in patsy/version.py again

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
if sys.version_info >= (3,):
1515
extra["use_2to3"] = True
1616

17+
# defines __version__
18+
exec(open("patsy/version.py").read())
19+
1720
setup(
1821
name="patsy",
19-
version="0.2.1+dev",
22+
version=__version__,
2023
description=DESC,
2124
long_description=LONG_DESC,
2225
author="Nathaniel J. Smith",

0 commit comments

Comments
 (0)