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

Proposed by Barry Warsaw
Status: Merged
Approved by: Barry Warsaw
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 (community) Approve
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
18. By Barry Warsaw

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.

Revision history for this message
Barry Warsaw (barry) wrote :

I like this change better.

Revision history for this message
Colin Watson (cjwatson) :
review: Approve
lp:~barry/lazr.config/tox-fix updated
19. By Barry Warsaw

Fix a couple of other paths.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MANIFEST.in'
2--- MANIFEST.in 2014-08-22 14:21:40 +0000
3+++ MANIFEST.in 2017-02-09 15:31:34 +0000
4@@ -1,3 +1,3 @@
5 include *.py *.txt *.rst MANIFEST.in *.ini
6-recursive-include lazr *.txt *.rst *.conf
7+recursive-include src/lazr *.txt *.rst *.conf
8 exclude .bzrignore
9
10=== modified file 'README.rst'
11--- README.rst 2013-01-10 21:39:27 +0000
12+++ README.rst 2017-02-09 15:31:34 +0000
13@@ -7,8 +7,8 @@
14 .. toctree::
15 :maxdepth: 2
16
17- lazr/config/docs/usage
18- lazr/config/docs/NEWS
19+ src/lazr/config/docs/usage
20+ src/lazr/config/docs/NEWS
21 HACKING
22
23
24
25=== modified file 'conf.py'
26--- conf.py 2015-01-06 00:52:55 +0000
27+++ conf.py 2017-02-09 15:31:34 +0000
28@@ -49,7 +49,7 @@
29 # built documents.
30 #
31 # The short X.Y version.
32-version = open('lazr/config/version.txt').read().strip()
33+version = open('src/lazr/config/version.txt').read().strip()
34 # The full version, including alpha/beta/rc tags.
35 release = version
36
37
38=== modified file 'setup.py'
39--- setup.py 2015-01-06 00:52:55 +0000
40+++ setup.py 2017-02-09 15:31:34 +0000
41@@ -16,13 +16,14 @@
42
43 from setuptools import setup, find_packages
44
45-__version__ = open("lazr/config/version.txt").read().strip()
46+__version__ = open("src/lazr/config/version.txt").read().strip()
47
48 setup(
49 name='lazr.config',
50 version=__version__,
51 namespace_packages=['lazr'],
52- packages=find_packages(),
53+ packages=find_packages('src'),
54+ package_dir={'': 'src'},
55 include_package_data=True,
56 zip_safe=False,
57 maintainer='LAZR Developers',
58@@ -40,7 +41,6 @@
59 """,
60 license='LGPL v3',
61 install_requires=[
62- 'nose',
63 'setuptools',
64 'zope.interface',
65 'lazr.delegates',
66
67=== added directory 'src'
68=== renamed directory 'lazr' => 'src/lazr'
69=== modified file 'src/lazr/config/__init__.py'
70--- lazr/config/__init__.py 2015-01-06 00:52:55 +0000
71+++ src/lazr/config/__init__.py 2017-02-09 15:31:34 +0000
72@@ -20,13 +20,8 @@
73 __version__ = pkg_resources.resource_string(
74 "lazr.config", "version.txt").strip()
75
76-# Re-export in such a way that __version__ can still be imported if
77-# dependencies are not yet available.
78-try:
79- # While we generally frown on "*" imports, this, combined with the fact we
80- # only test code from this module, means that we can verify what has been
81- # exported.
82- from lazr.config._config import *
83- from lazr.config._config import __all__
84-except ImportError:
85- pass
86+# While we generally frown on "*" imports, this, combined with the fact we
87+# only test code from this module, means that we can verify what has been
88+# exported.
89+from lazr.config._config import *
90+from lazr.config._config import __all__
91
92=== modified file 'src/lazr/config/docs/NEWS.rst'
93--- lazr/config/docs/NEWS.rst 2015-01-06 01:58:53 +0000
94+++ src/lazr/config/docs/NEWS.rst 2017-02-09 15:31:34 +0000
95@@ -2,6 +2,20 @@
96 NEWS for lazr.config
97 ====================
98
99+2.2 (2017-02-07)
100+================
101+- Fix tox import failure related to https://github.com/tox-dev/tox/issues/453
102+ (LP: #1662701)
103+- Don't catch ImportErrors that might occur when importing lazr.config._config
104+ from lazr/config/__init__.py. It's unnecessary and masks legitimate
105+ ImportErrors of e.g. lazr.delegates.
106+- setup.py: nose is not an install_requires, so move this dependency to
107+ tox.ini. (LP: #1649726)
108+- tox.ini: Add the py36 environment and drop py32, py33. Ignore missing
109+ interpreters. Change to a temporary directory when running tox (to avoid
110+ the above tox bug). Invoke nose via -m instead of the mostly deprecated
111+ ``python setup.py`` approach.
112+
113 2.1 (2015-01-05)
114 ================
115 - Always use old-style namespace package registration in ``lazr/__init__.py``
116
117=== modified file 'src/lazr/config/docs/usage.rst'
118--- lazr/config/docs/usage.rst 2015-01-06 02:02:23 +0000
119+++ src/lazr/config/docs/usage.rst 2017-02-09 15:31:34 +0000
120@@ -1194,7 +1194,7 @@
121 >>> as_username_groupname('foo')
122 Traceback (most recent call last):
123 ...
124- ValueError: need more than 1 value to unpack
125+ ValueError: ...
126
127 When both are given, the strings are returned unchanged or validated.
128
129@@ -1328,7 +1328,7 @@
130 >>> as_log_level('cheese')
131 Traceback (most recent call last):
132 ...
133- AttributeError: 'module' object has no attribute 'CHEESE'
134+ AttributeError: ...
135
136
137 Other Documents
138
139=== modified file 'src/lazr/config/version.txt'
140--- lazr/config/version.txt 2015-01-06 00:52:55 +0000
141+++ src/lazr/config/version.txt 2017-02-09 15:31:34 +0000
142@@ -1,1 +1,1 @@
143-2.1
144+2.2
145
146=== modified file 'tox.ini'
147--- tox.ini 2014-08-22 14:21:16 +0000
148+++ tox.ini 2017-02-09 15:31:34 +0000
149@@ -1,5 +1,10 @@
150 [tox]
151-envlist = py27,py32,py33,py34
152+envlist = py27,py34,py35,py36
153+skip_missing_interpreters = True
154+
155
156 [testenv]
157-commands = python setup.py nosetests
158+commands = python -s -m nose -P lazr
159+deps =
160+ nose
161+ coverage

Subscribers

People subscribed via source and target branches