Set version in one file and one file alone.

This commit is contained in:
lericson 2009-09-19 21:42:37 +02:00
parent 1dda3f5522
commit e8817b6617
6 changed files with 10 additions and 2 deletions

View File

@ -876,6 +876,8 @@ Oh, and: plankton.\n");
PylibMCExc_MemcachedError = PyErr_NewException(
"_pylibmc.MemcachedError", NULL, NULL);
PyModule_AddStringConstant(module, "__version__", PYLIBMC_VERSION);
Py_INCREF(&PylibMC_ClientType);
PyModule_AddObject(module, "client", (PyObject *)&PylibMC_ClientType);

View File

@ -41,6 +41,8 @@
#include <Python.h>
#include <libmemcached/memcached.h>
#include "pylibmc-version.h"
/* Py_ssize_t appeared in Python 2.5. */
#ifndef PY_SSIZE_T_MAX
typedef ssize_t Py_ssize_t;

1
pylibmc-version.h Normal file
View File

@ -0,0 +1 @@
#define PYLIBMC_VERSION "0.7.4"

View File

@ -24,7 +24,7 @@ minor differences. If you should happen to spot any, file a bug!
import _pylibmc
__all__ = ["hashers", "distributions", "Client"]
__version__ = "0.7.4"
__version__ = _pylibmc.__version__
hashers, hashers_rvs = {}, {}
distributions, distributions_rvs = {}, {}

View File

@ -10,12 +10,13 @@ if "LIBMEMCACHED_DIR" in os.environ:
libdirs.append(os.path.join(libdir, "lib"))
readme_text = open("README.rst", "U").read()
version = open("pylibmc-version.h", "U").read().strip().split("\"")[1]
pylibmc_ext = Extension("_pylibmc", ["_pylibmcmodule.c"],
libraries=["memcached"],
include_dirs=incdirs, library_dirs=libdirs)
setup(name="pylibmc", version="0.7.4",
setup(name="pylibmc", version=version,
url="http://lericson.blogg.se/code/category/pylibmc.html",
author="Ludvig Ericson", author_email="ludvig@lericson.se",
license="3-clause BSD <http://www.opensource.org/licenses/bsd-license.php>",

View File

@ -1,6 +1,8 @@
"""Tests. They want YOU!!
Basic functionality.
>>> _pylibmc.__version__ == pylibmc.__version__
True
>>> c = _pylibmc.client([test_server])
>>> c.set("test_key", 123)
True