diff options
| author | martinko | 2014-04-09 15:59:41 +0000 |
|---|---|---|
| committer | martinko | 2014-04-09 15:59:41 +0000 |
| commit | 6a9886999803374012911d4d7c23b5cbe20d135d (patch) | |
| tree | 61387285df68b9e8ca6600959fbe0871565ce6cf | |
| parent | fc1e1f4b7a9b50418c41045c92fbe31947b83796 (diff) | |
| parent | 6cbc2e5037323718fed3d7a1ff7d8964db669599 (diff) | |
Merge branch 'hotfix/3.2.1'3.2.1
| -rw-r--r-- | NEWS | 12 | ||||
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | debian/changelog | 6 | ||||
| m--------- | lib | 0 | ||||
| -rw-r--r-- | python/skytools/scripting.py | 3 | ||||
| -rw-r--r-- | python/skytools/timeutil.py | 14 | ||||
| -rwxr-xr-x | scripts/simple_local_consumer.py | 6 | ||||
| -rwxr-xr-x | setup_pkgloader.py | 2 | ||||
| -rwxr-xr-x | setup_skytools.py | 58 |
9 files changed, 73 insertions, 30 deletions
@@ -1,4 +1,16 @@ +2014-04-09 - SkyTools 3.2.1 + + = Fixes = + + * skytools.scripting: moved psycopg2 reference to actual script using it + * skytools.timeutil: fixed for Python versions less than 2.7 + + = Cleanups = + + * libusual: updated to the latest version (that is already 9 months old) + * setup*.py: fixes; updated to point to correct licence + 2014-03-31 - SkyTools 3.2 - "Hit any user to continue" = Features = diff --git a/configure.ac b/configure.ac index 458deb5a..3d573ab1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(skytools, 3.2) +AC_INIT(skytools, 3.2.1) AC_CONFIG_SRCDIR(python/londiste.py) AC_CONFIG_HEADER(lib/usual/config.h) AC_PREREQ([2.59]) diff --git a/debian/changelog b/debian/changelog index 3712fc0b..066e8471 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +skytools3 (3.2.1) experimental; urgency=low + + * v3.2.1 + + -- martinko <gamato@users.sf.net> Wed, 09 Apr 2014 17:34:51 +0200 + skytools3 (3.2) experimental; urgency=low * v3.2 diff --git a/lib b/lib -Subproject 7b291d464c6ff1e6aa42a17d323ee07e2b7f266 +Subproject 2c1cb7f9bfa0a2a183354eb2630a3e4136d0f96 diff --git a/python/skytools/scripting.py b/python/skytools/scripting.py index 68ddc4d3..77c1bec5 100644 --- a/python/skytools/scripting.py +++ b/python/skytools/scripting.py @@ -14,7 +14,6 @@ import signal import sys import time -import psycopg2 import skytools import skytools.skylog @@ -958,7 +957,7 @@ class DBScript(BaseScript): sql_retry_formula_a = self.cf.getint("sql_retry_formula_a", 1) sql_retry_formula_b = self.cf.getint("sql_retry_formula_b", 5) sql_retry_formula_cap = self.cf.getint("sql_retry_formula_cap", 60) - elist = exceptions or (psycopg2.OperationalError,) + elist = exceptions or tuple([]) stime = time.time() tried = 0 dbc = None diff --git a/python/skytools/timeutil.py b/python/skytools/timeutil.py index 2ea63082..c04756b8 100644 --- a/python/skytools/timeutil.py +++ b/python/skytools/timeutil.py @@ -16,6 +16,20 @@ from datetime import datetime, timedelta, tzinfo __all__ = ['parse_iso_timestamp', 'FixedOffsetTimezone', 'datetime_to_timestamp'] +try: + timedelta.total_seconds # new in 2.7 +except AttributeError: + def total_seconds(td): + return float (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 + + import ctypes + _get_dict = ctypes.pythonapi._PyObject_GetDictPtr + _get_dict.restype = ctypes.POINTER(ctypes.py_object) + _get_dict.argtypes = [ctypes.py_object] + d = _get_dict(timedelta)[0] + d['total_seconds'] = total_seconds + + class FixedOffsetTimezone(tzinfo): """Fixed offset in minutes east from UTC.""" __slots__ = ('__offset', '__name') diff --git a/scripts/simple_local_consumer.py b/scripts/simple_local_consumer.py index 50177097..e78ba0b4 100755 --- a/scripts/simple_local_consumer.py +++ b/scripts/simple_local_consumer.py @@ -22,12 +22,15 @@ Config:: import sys +import psycopg2 + import pkgloader pkgloader.require('skytools', '3.0') import pgq import skytools + class SimpleLocalConsumer(pgq.LocalConsumer): __doc__ = __doc__ @@ -57,7 +60,8 @@ class SimpleLocalConsumer(pgq.LocalConsumer): payload['pgq.ev_extra4'] = ev.ev_extra4 self.log.debug(self.dst_query, payload) - retries, curs = self.execute_with_retry('dst_db', self.dst_query, payload) + retries, curs = self.execute_with_retry('dst_db', self.dst_query, payload, + exceptions = (psycopg2.OperationalError,)) if curs.statusmessage[:6] == 'SELECT': res = curs.fetchall() self.log.debug(res) diff --git a/setup_pkgloader.py b/setup_pkgloader.py index 28b15d73..41669861 100755 --- a/setup_pkgloader.py +++ b/setup_pkgloader.py @@ -4,7 +4,7 @@ from distutils.core import setup setup( name = "pkgloader", - license = "BSD", + license = "ISC", version = '1.0', maintainer = "Marko Kreen", maintainer_email = "markokr@gmail.com", diff --git a/setup_skytools.py b/setup_skytools.py index cc9a1a4c..ce52e250 100755 --- a/setup_skytools.py +++ b/setup_skytools.py @@ -20,7 +20,7 @@ from subprocess import Popen INSTALL_SCRIPTS = 1 INSTALL_SQL = 1 -# dont build C module on win32 as it's unlikely to have dev env +# don't build C module on win32 as it's unlikely to have dev env BUILD_C_MOD = 1 if sys.platform == 'win32': BUILD_C_MOD = 0 @@ -53,19 +53,19 @@ if not INSTALL_SCRIPTS: # sql files we want to access from python sql_files = [ - 'sql/pgq/pgq.sql', - 'sql/londiste/londiste.sql', - 'sql/pgq_node/pgq_node.sql', - 'sql/pgq_coop/pgq_coop.sql', - 'sql/pgq_ext/pgq_ext.sql', - - 'sql/pgq/pgq.upgrade.sql', - 'sql/pgq_node/pgq_node.upgrade.sql', - 'sql/londiste/londiste.upgrade.sql', - 'sql/pgq_coop/pgq_coop.upgrade.sql', - 'sql/pgq_ext/pgq_ext.upgrade.sql', - 'upgrade/final/pgq.upgrade_2.1_to_3.0.sql', - 'upgrade/final/londiste.upgrade_2.1_to_3.1.sql', + 'sql/pgq/pgq.sql', + 'sql/londiste/londiste.sql', + 'sql/pgq_node/pgq_node.sql', + 'sql/pgq_coop/pgq_coop.sql', + 'sql/pgq_ext/pgq_ext.sql', + + 'sql/pgq/pgq.upgrade.sql', + 'sql/pgq_node/pgq_node.upgrade.sql', + 'sql/londiste/londiste.upgrade.sql', + 'sql/pgq_coop/pgq_coop.upgrade.sql', + 'sql/pgq_ext/pgq_ext.upgrade.sql', + 'upgrade/final/pgq.upgrade_2.1_to_3.0.sql', + 'upgrade/final/londiste.upgrade_2.1_to_3.1.sql', ] # sql files for special occasions @@ -87,7 +87,7 @@ def getvar(name, default): pass return default -# dont rename scripts on win32 +# don't rename scripts on win32 if sys.platform == 'win32': DEF_SUFFIX = '.py' DEF_NOSUFFIX = '.py' @@ -100,7 +100,7 @@ DEF_SUFFIX = getvar('SUFFIX', DEF_SUFFIX) DEF_SKYLOG = getvar('SKYLOG', '0') != '0' DEF_SK3_SUBDIR = getvar('SK3_SUBDIR', '0') != '0' -# create sql files if they dont exist +# create sql files if they don't exist def make_sql(): for fn in sql_files: if not os.path.isfile(fn): @@ -155,8 +155,8 @@ class sk3_build_scripts(build_scripts): # wrap generic install command class sk3_install(install): user_options = install.user_options + [ - ('sk3-subdir', None, 'install modules into "skytools-3.0" subdir'), - ('skylog', None, 'use "skylog" logging by default'), + ('sk3-subdir', None, 'install modules into "skytools-3.0" subdir'), + ('skylog', None, 'use "skylog" logging by default'), ] boolean_options = ['sk3-subdir', 'skylog'] sk3_subdir = DEF_SK3_SUBDIR @@ -187,26 +187,28 @@ if BUILD_C_MOD: ext = [ Extension("skytools._cquoting", ['python/modules/cquoting.c']), Extension("skytools._chashtext", ['python/modules/hashtext.c']), - ] + ] c_modules.extend(ext) # run actual setup setup( name = "skytools", - license = "BSD", + license = "ISC", version = ac_ver, maintainer = "Marko Kreen", maintainer_email = "markokr@gmail.com", url = "http://pgfoundry.org/projects/skytools/", + description = "SkyTools - tools for PostgreSQL", + platforms = "POSIX, MacOS, Windows", package_dir = {'': 'python'}, packages = ['skytools', 'londiste', 'londiste.handlers', 'pgq', 'pgq.cascade'], data_files = [ - ('share/doc/skytools3/conf', [ - 'python/conf/wal-master.ini', - 'python/conf/wal-slave.ini', + ('share/doc/skytools3/conf', [ + 'python/conf/wal-master.ini', + 'python/conf/wal-slave.ini', ]), - ('share/skytools3', sql_files), - #('share/skytools3/extra', extra_sql_files), + ('share/skytools3', sql_files), + #('share/skytools3/extra', extra_sql_files), ], ext_modules = c_modules, scripts = sfx_scripts + nosfx_scripts, @@ -215,4 +217,10 @@ setup( 'build_scripts': sk3_build_scripts, 'install': sk3_install, }, + long_description = """ +This is a package of tools developed at Skype for replication and failover. +It includes a generic queuing framework (PgQ), easy-to-use replication +implementation (Londiste), tool for managing WAL based standby servers, +utility library for Python scripts, selection of scripts for specific jobs. +""" ) |
