← Back to team overview

divmod-dev team mailing list archive

[Merge] lp:~lvh/divmod.org/modernize-axiom-packaging into lp:divmod.org

 

Laurens Van Houtven has proposed merging lp:~lvh/divmod.org/modernize-axiom-packaging into lp:divmod.org.

Requested reviews:
  Divmod-dev (divmod-dev)

For more details, see:
https://code.launchpad.net/~lvh/divmod.org/modernize-axiom-packaging/+merge/180311

A number of changes to make Axiom a bit more present-day Python packaging compatible :)

setup.py now works without relying on non-stdlib projects. This makes it easier to pip install Axiom.

Also, tox has been configured to automagically make virtualenvs to run the tests in. This will hopefully make test runs more reproducible, instead of relying. It has the added benefit that our dependency specifications (previously DEPS.txt, now requirements.txt, for consistency with current packaging standards) are actually tested. As a free bonus, tox does coverage testing using coverage.py, too.
-- 
https://code.launchpad.net/~lvh/divmod.org/modernize-axiom-packaging/+merge/180311
Your team Divmod-dev is requested to review the proposed merge of lp:~lvh/divmod.org/modernize-axiom-packaging into lp:divmod.org.
=== added file 'Axiom/.coveragerc'
--- Axiom/.coveragerc	1970-01-01 00:00:00 +0000
+++ Axiom/.coveragerc	2013-08-15 10:06:29 +0000
@@ -0,0 +1,8 @@
+[run]
+branch = True
+source =
+    axiom 
+
+[report]
+exclude_lines =
+    pragma: no cover

=== modified file 'Axiom/axiom/__init__.py'
--- Axiom/axiom/__init__.py	2008-03-09 21:03:23 +0000
+++ Axiom/axiom/__init__.py	2013-08-15 10:06:29 +0000
@@ -1,5 +1,3 @@
 # -*- test-case-name: axiom.test -*-
-
-from axiom._version import version
-version                         # tell pyflakes we're exporting it.
-
+from axiom._version import __version__
+version = __version__

=== modified file 'Axiom/axiom/_version.py'
--- Axiom/axiom/_version.py	2009-11-30 01:08:55 +0000
+++ Axiom/axiom/_version.py	2013-08-15 10:06:29 +0000
@@ -1,3 +1,2 @@
-# This is an auto-generated file. Use Epsilon/bin/release-divmod to update.
 from twisted.python import versions
-version = versions.Version(__name__[:__name__.rfind('.')], 0, 6, 0)
+__version__ = versions.Version("axiom", 0, 6, 0)

=== added file 'Axiom/requirements-py24.txt'
--- Axiom/requirements-py24.txt	1970-01-01 00:00:00 +0000
+++ Axiom/requirements-py24.txt	2013-08-15 10:06:29 +0000
@@ -0,0 +1,2 @@
+# Python2.4 doesn't include stdlib SQLite, so requires
+pysqlite==2.6.3

=== added file 'Axiom/requirements-testing.txt'
--- Axiom/requirements-testing.txt	1970-01-01 00:00:00 +0000
+++ Axiom/requirements-testing.txt	2013-08-15 10:06:29 +0000
@@ -0,0 +1,2 @@
+# Requirements for running the test suite using tox
+coverage

=== renamed file 'Axiom/DEPS.txt' => 'Axiom/requirements.txt'
--- Axiom/DEPS.txt	2006-06-14 11:54:41 +0000
+++ Axiom/requirements.txt	2013-08-15 10:06:29 +0000
@@ -1,7 +1,5 @@
-Python 2.4
-SQLite 3.2.1
-Twisted 2.4.0
-PySQLite 2.0
-NPTL 2.3.5 or later (LinuxThreads not supported: see
-                     <http://twistedmatrix.com/bugs/issue1251>)
-Epsilon 0.5.0
+# This list is for Python 2.5 or better.
+# If you're using Python 2.4, see requirements-py24.txt.
+Twisted>=2.4.0
+Epsilon>=0.5.0
+PyOpenSSL # epsilon.juice depends on this

=== modified file 'Axiom/setup.py'
--- Axiom/setup.py	2009-11-30 01:08:55 +0000
+++ Axiom/setup.py	2013-08-15 10:06:29 +0000
@@ -1,23 +1,36 @@
-from epsilon.setuphelper import autosetup
-
-import axiom
-
-distobj = autosetup(
-    name="Axiom",
-    version=axiom.version.short(),
+import re
+import setuptools
+
+versionPattern = re.compile(
+    r"__version__ = versions\.Version\("
+    "\"(?P<package>\w*)\", "
+    "(?P<major>\d*), "
+    "(?P<minor>\d*), "
+    "(?P<micro>\d*)\)")
+
+with open("axiom/_version.py", "rt") as f:
+    match = versionPattern.search(f.read())
+    package, major, minor, micro = match.groups()
+
+setuptools.setup(
+    name=package.title(),
+    version=".".join([major, minor, micro]),
+    description="An in-process object-relational database",
+    url="http://divmod.org/trac/wiki/DivmodAxiom";,
+
     maintainer="Divmod, Inc.",
     maintainer_email="support@xxxxxxxxxx",
-    url="http://divmod.org/trac/wiki/DivmodAxiom";,
+
+    packages=setuptools.find_packages() + ["twisted.plugins"],
+    scripts=['bin/axiomatic'],
+
     license="MIT",
     platforms=["any"],
-    description="An in-process object-relational database",
+
     classifiers=[
         "Development Status :: 5 - Production/Stable",
         "Framework :: Twisted",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: MIT License",
         "Programming Language :: Python",
-        "Topic :: Database"],
-
-    scripts=['bin/axiomatic'])
-
+        "Topic :: Database"])

=== added file 'Axiom/tox.ini'
--- Axiom/tox.ini	1970-01-01 00:00:00 +0000
+++ Axiom/tox.ini	2013-08-15 10:06:29 +0000
@@ -0,0 +1,13 @@
+[tox]
+envlist = py27
+
+[testenv]
+commands =
+    pip install Twisted # Epsilon needs this in egg-info...
+    pip install \
+        -r {toxinidir}/requirements.txt \
+        -r {toxinidir}/requirements-testing.txt
+    coverage run \
+        {envdir}/bin/trial --temp-directory={envdir}/_trial {posargs:axiom}
+    coverage report --show-missing
+    coverage html --directory {envdir}/_coverage


Follow ups