File tree Expand file tree Collapse file tree 1 file changed +44
-1
lines changed Expand file tree Collapse file tree 1 file changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,50 @@ alongside the project code) are automatically filtered in the case of
115
115
.. autoattribute :: setuptools.discovery.FlatLayoutModuleFinder.DEFAULT_EXCLUDE
116
116
117
117
Also note that you can customise your project layout by explicitly setting
118
- :doc: `package_dir <userguide/declarative_config >`.
118
+ ``package_dir ``:
119
+
120
+ .. tab :: setup.cfg
121
+
122
+ .. code-block :: ini
123
+
124
+ [options]
125
+ # ...
126
+ package_dir =
127
+ = lib
128
+ # similar to "src-layout" but using the "lib" folder
129
+ # pkg.mod corresponds to lib/pkg/mod.py
130
+ # OR
131
+ package_dir =
132
+ pkg1 = lib1
133
+ # pkg1.mod corresponds to lib1/mod.py
134
+ # pkg1.subpkg.mod corresponds to lib1/subpkg/mod.py
135
+ pkg2 = lib2
136
+ # pkg2.mod corresponds to lib2/mod.py
137
+ pkg2.subpkg = lib3
138
+ # pkg2.subpkg.mod corresponds to lib3/mod.py
139
+
140
+ .. tab :: setup.py
141
+
142
+ .. code-block :: python
143
+
144
+ setup(
145
+ # ...
146
+ package_dir = {" " : " pkg" }
147
+ # similar to "src-layout" but using the "pkg" folder
148
+ # mylib.mod corresponds to pkg/mylib/mod.py
149
+ )
150
+
151
+ # OR
152
+
153
+ setup(
154
+ # ...
155
+ package_dir = {
156
+ " pkg1" : " lib1" , # pkg1.mod corresponds to lib1/mod.py
157
+ # pkg1.subpkg.mod corresponds to lib1/subpkg/mod.py
158
+ " pkg2" : " lib2" , # pkg2.mod corresponds to lib2/mod.py
159
+ " pkg2.subpkg" : " lib3" # pkg2.subpkg.mod corresponds to lib3/mod.py
160
+ # ...
161
+ )
119
162
120
163
.. important:: Automatic discovery will ** only** be enabled if you don' t
121
164
provide any configuration for both `` packages`` and `` py_modules`` .
You can’t perform that action at this time.
0 commit comments