Merge lp:~barry/lazr.config/tox-fix into lp:lazr.config

Proposed by Barry Warsaw on 2017-02-07
Status: Merged
Approved by: Barry Warsaw on 2017-02-09
Approved revision: 19
Merged at revision: 17
Proposed branch: lp:~barry/lazr.config/tox-fix
Merge into: lp:lazr.config
Diff against target: 161 lines (+36/-22)
9 files modified
MANIFEST.in (+1/-1)
README.rst (+2/-2)
conf.py (+1/-1)
setup.py (+3/-3)
src/lazr/config/__init__.py (+5/-10)
src/lazr/config/docs/NEWS.rst (+14/-0)
src/lazr/config/docs/usage.rst (+2/-2)
src/lazr/config/version.txt (+1/-1)
tox.ini (+7/-2)
To merge this branch: bzr merge lp:~barry/lazr.config/tox-fix
Reviewer Review Type Date Requested Status
Colin Watson 2017-02-07 Approve on 2017-02-09
Review via email: mp+316651@code.launchpad.net

Commit message

Fix Python 3.6 compatibility, and work around a problem with single-source bilingual namespace packages with dependencies in the same namespace.

Description of the change

2.2 (2017-02-07)
================
- Fix tox import failure related to https://github.com/tox-dev/tox/issues/453
  (LP: #1662701)
- Don't catch ImportErrors that might occur when importing lazr.config._config
  from lazr/config/__init__.py. It's unnecessary and masks legitimate
  ImportErrors of e.g. lazr.delegates.
- setup.py: nose is not an install_requires, so move this dependency to
  tox.ini. (LP: #1649726)
- tox.ini: Add the py36 environment and drop py32, py33. Ignore missing
  interpreters. Change to a temporary directory when running tox (to avoid
  the above tox bug). Invoke nose via -m instead of the mostly deprecated
  ``python setup.py`` approach.

To post a comment you must log in.
lp:~barry/lazr.config/tox-fix updated on 2017-02-08
18. By Barry Warsaw on 2017-02-08

Do a better job of isolation from cwd.

* Move the lazr subdirectory into src/
* Don't changedir in tox.ini.
* Add coverage as a dep to tox.ini
* Use python -s and nose -P for isolation.
* Adjust the doctest for compatibility of error strings between Python 2.7,
  3.5, and 3.6
* Add NEWS.

Barry Warsaw (barry) wrote :

I like this change better.

Colin Watson (cjwatson) :
review: Approve
lp:~barry/lazr.config/tox-fix updated on 2017-02-09
19. By Barry Warsaw on 2017-02-09

Fix a couple of other paths.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2014-08-22 14:21:40 +0000
+++ MANIFEST.in 2017-02-09 15:31:34 +0000
@@ -1,3 +1,3 @@
1include *.py *.txt *.rst MANIFEST.in *.ini1include *.py *.txt *.rst MANIFEST.in *.ini
2recursive-include lazr *.txt *.rst *.conf2recursive-include src/lazr *.txt *.rst *.conf
3exclude .bzrignore3exclude .bzrignore
44
=== modified file 'README.rst'
--- README.rst 2013-01-10 21:39:27 +0000
+++ README.rst 2017-02-09 15:31:34 +0000
@@ -7,8 +7,8 @@
7.. toctree::7.. toctree::
8 :maxdepth: 28 :maxdepth: 2
99
10 lazr/config/docs/usage10 src/lazr/config/docs/usage
11 lazr/config/docs/NEWS11 src/lazr/config/docs/NEWS
12 HACKING12 HACKING
1313
1414
1515
=== modified file 'conf.py'
--- conf.py 2015-01-06 00:52:55 +0000
+++ conf.py 2017-02-09 15:31:34 +0000
@@ -49,7 +49,7 @@
49# built documents.49# built documents.
50#50#
51# The short X.Y version.51# The short X.Y version.
52version = open('lazr/config/version.txt').read().strip()52version = open('src/lazr/config/version.txt').read().strip()
53# The full version, including alpha/beta/rc tags.53# The full version, including alpha/beta/rc tags.
54release = version54release = version
5555
5656
=== modified file 'setup.py'
--- setup.py 2015-01-06 00:52:55 +0000
+++ setup.py 2017-02-09 15:31:34 +0000
@@ -16,13 +16,14 @@
1616
17from setuptools import setup, find_packages17from setuptools import setup, find_packages
1818
19__version__ = open("lazr/config/version.txt").read().strip()19__version__ = open("src/lazr/config/version.txt").read().strip()
2020
21setup(21setup(
22 name='lazr.config',22 name='lazr.config',
23 version=__version__,23 version=__version__,
24 namespace_packages=['lazr'],24 namespace_packages=['lazr'],
25 packages=find_packages(),25 packages=find_packages('src'),
26 package_dir={'': 'src'},
26 include_package_data=True,27 include_package_data=True,
27 zip_safe=False,28 zip_safe=False,
28 maintainer='LAZR Developers',29 maintainer='LAZR Developers',
@@ -40,7 +41,6 @@
40""",41""",
41 license='LGPL v3',42 license='LGPL v3',
42 install_requires=[43 install_requires=[
43 'nose',
44 'setuptools',44 'setuptools',
45 'zope.interface',45 'zope.interface',
46 'lazr.delegates',46 'lazr.delegates',
4747
=== added directory 'src'
=== renamed directory 'lazr' => 'src/lazr'
=== modified file 'src/lazr/config/__init__.py'
--- lazr/config/__init__.py 2015-01-06 00:52:55 +0000
+++ src/lazr/config/__init__.py 2017-02-09 15:31:34 +0000
@@ -20,13 +20,8 @@
20__version__ = pkg_resources.resource_string(20__version__ = pkg_resources.resource_string(
21 "lazr.config", "version.txt").strip()21 "lazr.config", "version.txt").strip()
2222
23# Re-export in such a way that __version__ can still be imported if23# While we generally frown on "*" imports, this, combined with the fact we
24# dependencies are not yet available.24# only test code from this module, means that we can verify what has been
25try:25# exported.
26 # While we generally frown on "*" imports, this, combined with the fact we26from lazr.config._config import *
27 # only test code from this module, means that we can verify what has been27from lazr.config._config import __all__
28 # exported.
29 from lazr.config._config import *
30 from lazr.config._config import __all__
31except ImportError:
32 pass
3328
=== modified file 'src/lazr/config/docs/NEWS.rst'
--- lazr/config/docs/NEWS.rst 2015-01-06 01:58:53 +0000
+++ src/lazr/config/docs/NEWS.rst 2017-02-09 15:31:34 +0000
@@ -2,6 +2,20 @@
2NEWS for lazr.config2NEWS for lazr.config
3====================3====================
44
52.2 (2017-02-07)
6================
7- Fix tox import failure related to https://github.com/tox-dev/tox/issues/453
8 (LP: #1662701)
9- Don't catch ImportErrors that might occur when importing lazr.config._config
10 from lazr/config/__init__.py. It's unnecessary and masks legitimate
11 ImportErrors of e.g. lazr.delegates.
12- setup.py: nose is not an install_requires, so move this dependency to
13 tox.ini. (LP: #1649726)
14- tox.ini: Add the py36 environment and drop py32, py33. Ignore missing
15 interpreters. Change to a temporary directory when running tox (to avoid
16 the above tox bug). Invoke nose via -m instead of the mostly deprecated
17 ``python setup.py`` approach.
18
52.1 (2015-01-05)192.1 (2015-01-05)
6================20================
7- Always use old-style namespace package registration in ``lazr/__init__.py``21- Always use old-style namespace package registration in ``lazr/__init__.py``
822
=== modified file 'src/lazr/config/docs/usage.rst'
--- lazr/config/docs/usage.rst 2015-01-06 02:02:23 +0000
+++ src/lazr/config/docs/usage.rst 2017-02-09 15:31:34 +0000
@@ -1194,7 +1194,7 @@
1194 >>> as_username_groupname('foo')1194 >>> as_username_groupname('foo')
1195 Traceback (most recent call last):1195 Traceback (most recent call last):
1196 ...1196 ...
1197 ValueError: need more than 1 value to unpack1197 ValueError: ...
11981198
1199When both are given, the strings are returned unchanged or validated.1199When both are given, the strings are returned unchanged or validated.
12001200
@@ -1328,7 +1328,7 @@
1328 >>> as_log_level('cheese')1328 >>> as_log_level('cheese')
1329 Traceback (most recent call last):1329 Traceback (most recent call last):
1330 ...1330 ...
1331 AttributeError: 'module' object has no attribute 'CHEESE'1331 AttributeError: ...
13321332
13331333
1334Other Documents1334Other Documents
13351335
=== modified file 'src/lazr/config/version.txt'
--- lazr/config/version.txt 2015-01-06 00:52:55 +0000
+++ src/lazr/config/version.txt 2017-02-09 15:31:34 +0000
@@ -1,1 +1,1 @@
12.112.2
22
=== modified file 'tox.ini'
--- tox.ini 2014-08-22 14:21:16 +0000
+++ tox.ini 2017-02-09 15:31:34 +0000
@@ -1,5 +1,10 @@
1[tox]1[tox]
2envlist = py27,py32,py33,py342envlist = py27,py34,py35,py36
3skip_missing_interpreters = True
4
35
4[testenv]6[testenv]
5commands = python setup.py nosetests7commands = python -s -m nose -P lazr
8deps =
9 nose
10 coverage

Subscribers

People subscribed via source and target branches