Merge ~cjwatson/lazr.delegates:src-layout into lazr.delegates:main

Proposed by Colin Watson
Status: Merged
Merged at revision: beb45419ab04683d44f44b4835ca654391bc27f3
Proposed branch: ~cjwatson/lazr.delegates:src-layout
Merge into: lazr.delegates:main
Diff against target: 162 lines (+14/-7)
7 files modified
.gitignore (+1/-1)
MANIFEST.in (+1/-1)
dev/null (+0/-1)
setup.py (+3/-2)
src/lazr/delegates/docs/CONTRIBUTING.rst (+1/-0)
src/lazr/delegates/docs/NEWS.rst (+1/-0)
tox.ini (+7/-2)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+412215@code.launchpad.net

Commit message

Switch to a src directory layout

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote (last edit ):

You need to apply the following patch...

$ git diff
diff --git a/tox.ini b/tox.ini
index 0d823c9..10d788b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -42,3 +42,8 @@ commands =
 source = lazr.delegates
 omit = */docs/conf.py
 parallel = true
+
+[coverage:paths]
+source =
+ src
+ .tox/*/site-packages

otherwise - as we now test the actual packages and not the source - the executed paths will look like .tox/py38/lib/python3.8/site-packages/lazr/delegates/__init__.py and coverage combine would break.

Sorry, that goes on me for my coverage combine ambition.

review: Needs Fixing
Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks! I'd noticed some oddities, so I appreciate you tracking those down. Done.

Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 16ba64f..ca6d0d8 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -14,4 +14,4 @@ __pycache__
6 htmlcov
7 .tox
8 *.pyc
9-lazr/delegates/docs/_build
10+src/lazr/delegates/docs/_build
11diff --git a/MANIFEST.in b/MANIFEST.in
12index 0caef62..c722bb4 100644
13--- a/MANIFEST.in
14+++ b/MANIFEST.in
15@@ -1,3 +1,3 @@
16 include *.py *.txt *.rst MANIFEST.in *.ini
17-recursive-include lazr *.rst
18+recursive-include src/lazr *.rst
19 exclude .bzrignore
20diff --git a/lazr/delegates/docs/CONTRIBUTING.rst b/lazr/delegates/docs/CONTRIBUTING.rst
21deleted file mode 120000
22index ac9338f..0000000
23--- a/lazr/delegates/docs/CONTRIBUTING.rst
24+++ /dev/null
25@@ -1 +0,0 @@
26-../../../CONTRIBUTING.rst
27\ No newline at end of file
28diff --git a/lazr/delegates/docs/NEWS.rst b/lazr/delegates/docs/NEWS.rst
29deleted file mode 120000
30index c95df2b..0000000
31--- a/lazr/delegates/docs/NEWS.rst
32+++ /dev/null
33@@ -1 +0,0 @@
34-../../../NEWS.rst
35\ No newline at end of file
36diff --git a/setup.py b/setup.py
37index bfe9891..abe2368 100755
38--- a/setup.py
39+++ b/setup.py
40@@ -16,14 +16,15 @@
41
42 from setuptools import setup, find_packages
43
44-with open('lazr/delegates/_version.py') as version_file:
45+with open('src/lazr/delegates/_version.py') as version_file:
46 exec(version_file.read()) # sets __version__
47
48 setup(
49 name='lazr.delegates',
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',
58diff --git a/lazr/__init__.py b/src/lazr/__init__.py
59similarity index 100%
60rename from lazr/__init__.py
61rename to src/lazr/__init__.py
62diff --git a/lazr/delegates/__init__.py b/src/lazr/delegates/__init__.py
63similarity index 100%
64rename from lazr/delegates/__init__.py
65rename to src/lazr/delegates/__init__.py
66diff --git a/lazr/delegates/_delegates.py b/src/lazr/delegates/_delegates.py
67similarity index 100%
68rename from lazr/delegates/_delegates.py
69rename to src/lazr/delegates/_delegates.py
70diff --git a/lazr/delegates/_passthrough.py b/src/lazr/delegates/_passthrough.py
71similarity index 100%
72rename from lazr/delegates/_passthrough.py
73rename to src/lazr/delegates/_passthrough.py
74diff --git a/lazr/delegates/_python2.py b/src/lazr/delegates/_python2.py
75similarity index 100%
76rename from lazr/delegates/_python2.py
77rename to src/lazr/delegates/_python2.py
78diff --git a/lazr/delegates/_python3.py b/src/lazr/delegates/_python3.py
79similarity index 100%
80rename from lazr/delegates/_python3.py
81rename to src/lazr/delegates/_python3.py
82diff --git a/lazr/delegates/_version.py b/src/lazr/delegates/_version.py
83similarity index 100%
84rename from lazr/delegates/_version.py
85rename to src/lazr/delegates/_version.py
86diff --git a/src/lazr/delegates/docs/CONTRIBUTING.rst b/src/lazr/delegates/docs/CONTRIBUTING.rst
87new file mode 120000
88index 0000000..1d05313
89--- /dev/null
90+++ b/src/lazr/delegates/docs/CONTRIBUTING.rst
91@@ -0,0 +1 @@
92+../../../../CONTRIBUTING.rst
93\ No newline at end of file
94diff --git a/src/lazr/delegates/docs/NEWS.rst b/src/lazr/delegates/docs/NEWS.rst
95new file mode 120000
96index 0000000..27b815d
97--- /dev/null
98+++ b/src/lazr/delegates/docs/NEWS.rst
99@@ -0,0 +1 @@
100+../../../../NEWS.rst
101\ No newline at end of file
102diff --git a/lazr/delegates/docs/__init__.py b/src/lazr/delegates/docs/__init__.py
103similarity index 100%
104rename from lazr/delegates/docs/__init__.py
105rename to src/lazr/delegates/docs/__init__.py
106diff --git a/lazr/delegates/docs/conf.py b/src/lazr/delegates/docs/conf.py
107similarity index 100%
108rename from lazr/delegates/docs/conf.py
109rename to src/lazr/delegates/docs/conf.py
110diff --git a/lazr/delegates/docs/index.rst b/src/lazr/delegates/docs/index.rst
111similarity index 100%
112rename from lazr/delegates/docs/index.rst
113rename to src/lazr/delegates/docs/index.rst
114diff --git a/lazr/delegates/tests/__init__.py b/src/lazr/delegates/tests/__init__.py
115similarity index 100%
116rename from lazr/delegates/tests/__init__.py
117rename to src/lazr/delegates/tests/__init__.py
118diff --git a/lazr/delegates/tests/test_api.py b/src/lazr/delegates/tests/test_api.py
119similarity index 100%
120rename from lazr/delegates/tests/test_api.py
121rename to src/lazr/delegates/tests/test_api.py
122diff --git a/lazr/delegates/tests/test_docs.py b/src/lazr/delegates/tests/test_docs.py
123similarity index 100%
124rename from lazr/delegates/tests/test_docs.py
125rename to src/lazr/delegates/tests/test_docs.py
126diff --git a/lazr/delegates/tests/test_passthrough.py b/src/lazr/delegates/tests/test_passthrough.py
127similarity index 100%
128rename from lazr/delegates/tests/test_passthrough.py
129rename to src/lazr/delegates/tests/test_passthrough.py
130diff --git a/lazr/delegates/tests/test_python2.py b/src/lazr/delegates/tests/test_python2.py
131similarity index 100%
132rename from lazr/delegates/tests/test_python2.py
133rename to src/lazr/delegates/tests/test_python2.py
134diff --git a/tox.ini b/tox.ini
135index 57b23f3..10d788b 100644
136--- a/tox.ini
137+++ b/tox.ini
138@@ -15,13 +15,13 @@ deps =
139 zope.testrunner
140 coverage
141 commands =
142- coverage run -m zope.testrunner --test-path . --tests-pattern ^tests {posargs}
143+ coverage run -m zope.testrunner --test-path src --tests-pattern ^tests {posargs}
144
145 [testenv:docs]
146 basepython =
147 python3
148 commands =
149- sphinx-build -b html -d lazr/delegates/docs/_build/doctrees lazr/delegates/docs lazr/delegates/docs/_build/html
150+ sphinx-build -b html -d src/lazr/delegates/docs/_build/doctrees src/lazr/delegates/docs src/lazr/delegates/docs/_build/html
151 deps =
152 .[docs]
153
154@@ -42,3 +42,8 @@ commands =
155 source = lazr.delegates
156 omit = */docs/conf.py
157 parallel = true
158+
159+[coverage:paths]
160+source =
161+ src
162+ .tox/*/site-packages

Subscribers

People subscribed via source and target branches

to all changes: