Set version in one file and one file alone.
This commit is contained in:
parent
1dda3f5522
commit
e8817b6617
@ -876,6 +876,8 @@ Oh, and: plankton.\n");
|
|||||||
PylibMCExc_MemcachedError = PyErr_NewException(
|
PylibMCExc_MemcachedError = PyErr_NewException(
|
||||||
"_pylibmc.MemcachedError", NULL, NULL);
|
"_pylibmc.MemcachedError", NULL, NULL);
|
||||||
|
|
||||||
|
PyModule_AddStringConstant(module, "__version__", PYLIBMC_VERSION);
|
||||||
|
|
||||||
Py_INCREF(&PylibMC_ClientType);
|
Py_INCREF(&PylibMC_ClientType);
|
||||||
PyModule_AddObject(module, "client", (PyObject *)&PylibMC_ClientType);
|
PyModule_AddObject(module, "client", (PyObject *)&PylibMC_ClientType);
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
#include <libmemcached/memcached.h>
|
#include <libmemcached/memcached.h>
|
||||||
|
|
||||||
|
#include "pylibmc-version.h"
|
||||||
|
|
||||||
/* Py_ssize_t appeared in Python 2.5. */
|
/* Py_ssize_t appeared in Python 2.5. */
|
||||||
#ifndef PY_SSIZE_T_MAX
|
#ifndef PY_SSIZE_T_MAX
|
||||||
typedef ssize_t Py_ssize_t;
|
typedef ssize_t Py_ssize_t;
|
||||||
|
1
pylibmc-version.h
Normal file
1
pylibmc-version.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#define PYLIBMC_VERSION "0.7.4"
|
@ -24,7 +24,7 @@ minor differences. If you should happen to spot any, file a bug!
|
|||||||
import _pylibmc
|
import _pylibmc
|
||||||
|
|
||||||
__all__ = ["hashers", "distributions", "Client"]
|
__all__ = ["hashers", "distributions", "Client"]
|
||||||
__version__ = "0.7.4"
|
__version__ = _pylibmc.__version__
|
||||||
|
|
||||||
hashers, hashers_rvs = {}, {}
|
hashers, hashers_rvs = {}, {}
|
||||||
distributions, distributions_rvs = {}, {}
|
distributions, distributions_rvs = {}, {}
|
||||||
|
3
setup.py
3
setup.py
@ -10,12 +10,13 @@ if "LIBMEMCACHED_DIR" in os.environ:
|
|||||||
libdirs.append(os.path.join(libdir, "lib"))
|
libdirs.append(os.path.join(libdir, "lib"))
|
||||||
|
|
||||||
readme_text = open("README.rst", "U").read()
|
readme_text = open("README.rst", "U").read()
|
||||||
|
version = open("pylibmc-version.h", "U").read().strip().split("\"")[1]
|
||||||
|
|
||||||
pylibmc_ext = Extension("_pylibmc", ["_pylibmcmodule.c"],
|
pylibmc_ext = Extension("_pylibmc", ["_pylibmcmodule.c"],
|
||||||
libraries=["memcached"],
|
libraries=["memcached"],
|
||||||
include_dirs=incdirs, library_dirs=libdirs)
|
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",
|
url="http://lericson.blogg.se/code/category/pylibmc.html",
|
||||||
author="Ludvig Ericson", author_email="ludvig@lericson.se",
|
author="Ludvig Ericson", author_email="ludvig@lericson.se",
|
||||||
license="3-clause BSD <http://www.opensource.org/licenses/bsd-license.php>",
|
license="3-clause BSD <http://www.opensource.org/licenses/bsd-license.php>",
|
||||||
|
2
tests.py
2
tests.py
@ -1,6 +1,8 @@
|
|||||||
"""Tests. They want YOU!!
|
"""Tests. They want YOU!!
|
||||||
|
|
||||||
Basic functionality.
|
Basic functionality.
|
||||||
|
>>> _pylibmc.__version__ == pylibmc.__version__
|
||||||
|
True
|
||||||
>>> c = _pylibmc.client([test_server])
|
>>> c = _pylibmc.client([test_server])
|
||||||
>>> c.set("test_key", 123)
|
>>> c.set("test_key", 123)
|
||||||
True
|
True
|
||||||
|
Reference in New Issue
Block a user