[Python-modules-commits] [lazr.config] 01/04: Import lazr.config_2.1.orig.tar.gz
Barry Warsaw
barry at moszumanska.debian.org
Fri Jan 9 22:37:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository lazr.config.
commit cef48e96be9d938f32ac3204c10c03577cf567da
Author: Barry Warsaw <barry at ubuntu.com>
Date: Fri Jan 9 15:53:28 2015 -0500
Import lazr.config_2.1.orig.tar.gz
---
PKG-INFO | 2 +-
conf.py | 2 +-
lazr.config.egg-info/PKG-INFO | 2 +-
lazr/__init__.py | 20 ++++++++------------
lazr/config/__init__.py | 2 +-
lazr/config/_config.py | 12 ++++++++++--
lazr/config/docs/NEWS.rst | 20 +++++++-------------
lazr/config/docs/fixture.py | 2 +-
lazr/config/docs/usage.rst | 1 -
lazr/config/docs/usage_fixture.py | 2 +-
lazr/config/interfaces.py | 2 +-
lazr/config/tests/test_config.py | 16 +++++++++++++++-
lazr/config/version.txt | 2 +-
setup.py | 6 +-----
14 files changed, 49 insertions(+), 42 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 6b0540d..86a4f74 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: lazr.config
-Version: 2.0.1
+Version: 2.1
Summary: Create configuration schemas, and process and validate configurations.
Home-page: https://launchpad.net/lazr.config
Author: LAZR Developers
diff --git a/conf.py b/conf.py
index e6f8337..3c6af12 100644
--- a/conf.py
+++ b/conf.py
@@ -42,7 +42,7 @@ master_doc = 'README'
# General information about the project.
project = u'lazr.config'
-copyright = u'2013-2014, LAZR developers'
+copyright = u'2013-2015, LAZR developers'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/lazr.config.egg-info/PKG-INFO b/lazr.config.egg-info/PKG-INFO
index 6b0540d..86a4f74 100644
--- a/lazr.config.egg-info/PKG-INFO
+++ b/lazr.config.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: lazr.config
-Version: 2.0.1
+Version: 2.1
Summary: Create configuration schemas, and process and validate configurations.
Home-page: https://launchpad.net/lazr.config
Author: LAZR Developers
diff --git a/lazr/__init__.py b/lazr/__init__.py
index f65053d..91ac6ff 100644
--- a/lazr/__init__.py
+++ b/lazr/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2008-2014 Canonical Ltd. All rights reserved.
+# Copyright 2008-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.config.
#
@@ -14,14 +14,10 @@
# You should have received a copy of the GNU Lesser General Public License
# along with lazr.config. If not, see <http://www.gnu.org/licenses/>.
-# This is a namespace package, however under >= Python 3.3, let it be a true
-# namespace package (i.e. this cruft isn't necessary).
-import sys
-
-if sys.hexversion < 0x30300f0:
- try:
- import pkg_resources
- pkg_resources.declare_namespace(__name__)
- except ImportError:
- import pkgutil
- __path__ = pkgutil.extend_path(__path__, __name__)
+# This is a namespace package.
+try:
+ import pkg_resources
+ pkg_resources.declare_namespace(__name__)
+except ImportError:
+ import pkgutil
+ __path__ = pkgutil.extend_path(__path__, __name__)
diff --git a/lazr/config/__init__.py b/lazr/config/__init__.py
index 5205d7b..61f720a 100644
--- a/lazr/config/__init__.py
+++ b/lazr/config/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2009 Canonical Ltd. All rights reserved.
+# Copyright 2007-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.config
#
diff --git a/lazr/config/_config.py b/lazr/config/_config.py
index 97394c4..3754501 100644
--- a/lazr/config/_config.py
+++ b/lazr/config/_config.py
@@ -1,4 +1,4 @@
-# Copyright 2008-2014 Canonical Ltd. All rights reserved.
+# Copyright 2008-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.config.
#
@@ -41,6 +41,7 @@ import logging
import os
import pwd
import re
+import sys
from os.path import abspath, basename, dirname
from textwrap import dedent
@@ -572,7 +573,14 @@ class Config:
if confs is None:
confs = []
encoding_errors = self._verifyEncoding(conf_data)
- parser = RawConfigParser()
+ # LP: #1397779. In Python 3, RawConfigParser grew a `strict` keyword
+ # option and in Python 3.2, this argument changed its default from
+ # False to True. This breaks behavior compatibility with Python 2, so
+ # under Python 3, always force strict=False.
+ kws = {}
+ if sys.version_info >= (3,):
+ kws['strict'] = False
+ parser = RawConfigParser(**kws)
parser.readfp(StringIO(conf_data), conf_filename)
confs.append((conf_filename, parser, encoding_errors))
if parser.has_option('meta', 'extends'):
diff --git a/lazr/config/docs/NEWS.rst b/lazr/config/docs/NEWS.rst
index 58f58ff..d799e6a 100644
--- a/lazr/config/docs/NEWS.rst
+++ b/lazr/config/docs/NEWS.rst
@@ -2,42 +2,41 @@
NEWS for lazr.config
====================
+2.1 (2015-01-05)
+================
+- Always use old-style namespace package registration in ``lazr/__init__.py``
+ since the mere presence of this file subverts PEP 420 style namespace
+ packages. (LP: #1407816)
+- For behavioral compatibility between Python 2 and 3, `strict=False` must be
+ passed to the underlying `RawConfigParser` under Python 3. (LP: #1397779)
2.0.1 (2014-08-22)
==================
- Drop the use of `distribute` in favor of `setuptools`. (LP: #1359926)
- Run the test suite with `tox`.
-
2.0 (2013-01-10)
================
- Ported to Python 3.
- Now more strict in its requirement of ASCII in config files.
- Category names are now sorted by default.
-
1.1.3 (2009-08-25)
==================
-
- Fixed a build problem.
1.1.2 (2009-08-25)
==================
-
- Got rid of a sys.path hack.
-
1.1.1 (2009-03-24)
==================
-
- License clarification: only v3 of the LGPL is offered at this time, not
subsequent versions.
-
- Build is updated to support Sphinx docs and other small changes.
1.1 (2009-01-05)
================
-
- Support for adding arbitrary sections in a configuration file, based on a
.master section in the schema. The .master section allows admins to define
configurations for an arbitrary number of processes. If the schema defines
@@ -45,18 +44,13 @@ NEWS for lazr.config
.master section. These are like categories with templates except that the
section names extending .master need not be named in the schema file.
[Bug 310619]
-
- ConfigSchema now provides an interface for constructing the schema from a
string. [Bug 309859]
-
- Added as_boolean() and as_log_level() type converters. [Bug 310782]
-
- getByCategory() accepts a default argument. If the category is missing, the
default argument is returned. If the category is missing and no default
argument is given, a NoCategoryError is raised, as before. [Bug 309988]
-
1.0 (2008-12-19)
================
-
- Initial release
diff --git a/lazr/config/docs/fixture.py b/lazr/config/docs/fixture.py
index f00ce30..c1e3c1e 100644
--- a/lazr/config/docs/fixture.py
+++ b/lazr/config/docs/fixture.py
@@ -1,4 +1,4 @@
-# Copyright 2009-2014 Canonical Ltd. All rights reserved.
+# Copyright 2009-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.smtptest
#
diff --git a/lazr/config/docs/usage.rst b/lazr/config/docs/usage.rst
index c9eedad..ec5cb10 100644
--- a/lazr/config/docs/usage.rst
+++ b/lazr/config/docs/usage.rst
@@ -1338,6 +1338,5 @@ Other Documents
:glob:
*
- docs/*
.. _timedelta: http://docs.python.org/3/library/datetime.html#timedelta-objects
diff --git a/lazr/config/docs/usage_fixture.py b/lazr/config/docs/usage_fixture.py
index 4935117..280d5c9 100644
--- a/lazr/config/docs/usage_fixture.py
+++ b/lazr/config/docs/usage_fixture.py
@@ -1,4 +1,4 @@
-# Copyright 2009-2014 Canonical Ltd. All rights reserved.
+# Copyright 2009-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.smtptest
#
diff --git a/lazr/config/interfaces.py b/lazr/config/interfaces.py
index 83fc9a8..1d0939f 100644
--- a/lazr/config/interfaces.py
+++ b/lazr/config/interfaces.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2014 Canonical Ltd. All rights reserved.
+# Copyright 2007-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.config
#
diff --git a/lazr/config/tests/test_config.py b/lazr/config/tests/test_config.py
index e97ad76..a9d0c15 100644
--- a/lazr/config/tests/test_config.py
+++ b/lazr/config/tests/test_config.py
@@ -1,4 +1,4 @@
-# Copyright 2008-2014 Canonical Ltd. All rights reserved.
+# Copyright 2008-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.config.
#
@@ -203,3 +203,17 @@ multiline value 1
self.meq(config['section_33'].key2, """\
multiline value 1
multiline value 2""")
+
+ def test_lp1397779(self):
+ # Fix DuplicateSectionErrors when you .push() a config that has a
+ # section already defined in the config.
+ schema = ConfigSchema(self._testfile('base.conf'))
+ config = schema.load(self._testfile('local.conf'))
+ self.assertEqual(config['section_1']['key1'], 'foo')
+ config.push('dupsec', """\
+[section_1]
+key1: baz
+[section_1]
+key1: qux
+""")
+ self.assertEqual(config['section_1']['key1'], 'qux')
diff --git a/lazr/config/version.txt b/lazr/config/version.txt
index 38f77a6..879b416 100644
--- a/lazr/config/version.txt
+++ b/lazr/config/version.txt
@@ -1 +1 @@
-2.0.1
+2.1
diff --git a/setup.py b/setup.py
index 9b7ce82..da9fc1f 100755
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-# Copyright 2008-2014 Canonical Ltd. All rights reserved.
+# Copyright 2008-2015 Canonical Ltd. All rights reserved.
#
# This file is part of lazr.config.
#
@@ -57,8 +57,4 @@ files. The format supports schema validation.
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
],
- # nose plugins don't really work with `python setup.py test` so use
- # `python setup.py nosetests` instead, or just `tox`. Gosh, we really
- # should switch to nose2. :/ - BAW 2014-08-20
- #test_suite='nose.collector',
)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/lazr.config.git
More information about the Python-modules-commits
mailing list