summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-08-06 17:49:53 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-08-06 17:51:17 -0700
commitd0b375cdb74aaf9b93139621e7587f5fa45dcad8 (patch)
treed8319fa4613eff59d397fd15639cb6f40e0697b4
parent9fb3d2759f920bb6714ec6471a5c932720c6903a (diff)
downloadattobuild-d0b375cdb74aaf9b93139621e7587f5fa45dcad8.tar.gz
attobuild-d0b375cdb74aaf9b93139621e7587f5fa45dcad8.tar.bz2
attobuild-d0b375cdb74aaf9b93139621e7587f5fa45dcad8.tar.xz
attobuild-d0b375cdb74aaf9b93139621e7587f5fa45dcad8.zip
Fix versioning
-rw-r--r--attoconf/_version.py2
-rw-r--r--attoconf/lib/make.py4
-rw-r--r--attoconf/tests/test_version.py5
-rw-r--r--attoconf/version.py5
-rwxr-xr-xdemo-project/configure6
-rwxr-xr-xsetup.py5
6 files changed, 15 insertions, 12 deletions
diff --git a/attoconf/_version.py b/attoconf/_version.py
index 74a4f45..074f773 100644
--- a/attoconf/_version.py
+++ b/attoconf/_version.py
@@ -7,7 +7,7 @@ major = 0
# Incremented for releases with compatible API additions.
# This is the number that is usually incremented.
-minor = 4
+minor = 5
# Incremented if there is a bugfix release.
# Might not be contiguous.
diff --git a/attoconf/lib/make.py b/attoconf/lib/make.py
index 7e2c9d3..ec03d1d 100644
--- a/attoconf/lib/make.py
+++ b/attoconf/lib/make.py
@@ -20,7 +20,7 @@ from __future__ import print_function, division, absolute_import
import os
from ..classy import ClassyProject
-from ..version import string as version_string
+from ..version import full_version
blacklist = frozenset(''.join(chr(i) for i in range(0x20)) + '#$')
def validate(s):
@@ -40,7 +40,7 @@ class MakeHook(object):
return
with open(os.path.join(build.builddir, self.outfile), 'w') as out:
print('Generating a makefile ...')
- out.write('# This part was generated by %s\n' % version_string)
+ out.write('# This part was generated by %s\n' % full_version)
build.vars['SRC_DIR'] = (build.relative_source(), 'special')
for var in build.project.order:
if var is None:
diff --git a/attoconf/tests/test_version.py b/attoconf/tests/test_version.py
index 1ce855d..4325fba 100644
--- a/attoconf/tests/test_version.py
+++ b/attoconf/tests/test_version.py
@@ -19,13 +19,14 @@ from __future__ import print_function, division, absolute_import
import unittest
-from attoconf.version import require_version, string as version_string
+from attoconf.version import require_version, full_version, part_version
class TestVersion(unittest.TestCase):
def test_parse(self):
# don't do this
- name, version, dist = version_string.split(' ', 2)
+ name, version, dist = full_version.split(' ', 2)
self.assertEqual(name, 'attoconf')
+ self.assertEqual(version, part_version)
major, minor, patch = [int(x) for x in version.split('.')]
assert dist.startswith('(')
assert dist.endswith(')')
diff --git a/attoconf/version.py b/attoconf/version.py
index 231a3d1..3194aec 100644
--- a/attoconf/version.py
+++ b/attoconf/version.py
@@ -28,7 +28,7 @@ def require_version(major, minor, patch=0):
''' Check that this is the right version of attoconf, or die trying.
'''
- actual = 'Current version: ' + string
+ actual = 'Current version: ' + full_version
if major != _version.major:
sys.exit('Unsupported major version: %d\n' % major + actual)
if minor > _version.minor:
@@ -36,4 +36,5 @@ def require_version(major, minor, patch=0):
if minor == _version.minor and patch > _version.patch:
sys.exit('Unsupported patch version: %d.%d.%d\n' % (major, minor, patch) + actual)
-string = 'attoconf %d.%d.%d (%s)' % (_version.major, _version.minor, _version.patch, _version.distributor)
+part_version = '%d.%d.%d' % (_version.major, _version.minor, _version.patch)
+full_version = 'attoconf %s (%s)' % (part_version, _version.distributor)
diff --git a/demo-project/configure b/demo-project/configure
index c26e557..ce2cc45 100755
--- a/demo-project/configure
+++ b/demo-project/configure
@@ -22,8 +22,8 @@ from __future__ import print_function, division, absolute_import
import os
import sys
-from attoconf.version import require_version, string as version_string
-require_version(0, 2)
+from attoconf.version import require_version, part_version
+require_version(0, 5)
from attoconf.classy import add_slots
from attoconf.lib.c import C
@@ -66,7 +66,7 @@ class Configuration(C, Install, ConfigHash, Make):
def main():
proj = Configuration(os.path.dirname(sys.argv[0]))
- proj.set_package('attoconf-demo', version_string.split(' ')[1], 'Demo project for attoconf')
+ proj.set_package('attoconf-demo', part_version, 'Demo project for attoconf')
proj.jiggle()
build = proj.build('.')
build.configure(sys.argv[1:], os.environ)
diff --git a/setup.py b/setup.py
index 5e27239..2357bce 100755
--- a/setup.py
+++ b/setup.py
@@ -2,17 +2,18 @@
from distutils.core import setup
-from attoconf.version import version_string
+from attoconf.version import part_version
setup(
name='attoconf',
- version=version_string,
+ version=part_version,
description='A small and sensible replacement for GNU autoconf',
author='Ben Longbons',
author_email='b.r.longbons@gmail.com',
url='http://github.com/o11c/attoconf',
packages=[
'attoconf',
+ 'attoconf.lib',
],
classifiers=[
'Development Status :: 3 - Alpha',