36
36
import subprocess
37
37
import tempfile
38
38
39
+ # pyproject.toml `py_modules` values that are incorrect. These should all have PRs filed!
40
+ # and should be removed when the fixed version is incorporated in its respective bundle.
41
+
42
+ pyproject_py_modules_blacklist = set ((
43
+ # adafruit bundle
44
+ "adafruit_colorsys" ,
45
+
46
+ # community bundle
47
+ "at24mac_eeprom" ,
48
+ "circuitpython_Candlesticks" ,
49
+ "CircuitPython_Color_Picker" ,
50
+ "CircuitPython_Equalizer" ,
51
+ "CircuitPython_Scales" ,
52
+ "circuitPython_Slider" ,
53
+ "circuitpython_uboxplot" ,
54
+ "P1AM" ,
55
+ "p1am_200_helpers" ,
56
+ ))
57
+
39
58
if sys .version_info >= (3 , 11 ):
40
59
from tomllib import loads as load_toml
41
60
else :
@@ -175,6 +194,12 @@ def get_package_info(library_path, package_folder_prefix):
175
194
py_modules = get_nested (pyproject_toml , "tool" , "setuptools" , "py-modules" , default = [])
176
195
packages = get_nested (pyproject_toml , "tool" , "setuptools" , "packages" , default = [])
177
196
197
+ blacklisted = [name for name in py_modules if name in pyproject_py_modules_blacklist ]
198
+
199
+ if blacklisted :
200
+ print (f"{ lib_path } /settings.toml:1: { blacklisted [0 ]} blacklisted: not using metadata from pyproject.toml" )
201
+ py_modules = packages = ()
202
+
178
203
example_files = [sub_path for sub_path in (lib_path / "examples" ).rglob ("*" )
179
204
if sub_path .is_file ()]
180
205
@@ -185,7 +210,7 @@ def get_package_info(library_path, package_folder_prefix):
185
210
if len (packages ) > 1 :
186
211
raise ValueError ("Only a single package is supported" )
187
212
package_name = packages [0 ]
188
- print (f"Using package name from pyproject.toml: { package_name } " )
213
+ # print(f"Using package name from pyproject.toml: {package_name}")
189
214
package_info ["is_package" ] = True
190
215
package_info ["module_name" ] = package_name
191
216
package_files = [sub_path for sub_path in (lib_path / package_name ).rglob ("*" )
@@ -194,15 +219,15 @@ def get_package_info(library_path, package_folder_prefix):
194
219
elif py_modules :
195
220
if len (py_modules ) > 1 :
196
221
raise ValueError ("Only a single module is supported" )
197
- print ("Using module name from pyproject.toml" )
198
222
py_module = py_modules [0 ]
223
+ #print(f"Using module name from pyproject.toml: {py_module}")
199
224
package_name = py_module
200
225
package_info ["is_package" ] = False
201
226
package_info ["module_name" ] = py_module
202
227
py_files = [lib_path / f"{ py_module } .py" ]
203
228
204
229
else :
205
- print (" Using legacy autodetection" )
230
+ print (f" { lib_path } : Using legacy autodetection" )
206
231
package_info ["is_package" ] = False
207
232
for file in glob_search :
208
233
if file .parts [parent_idx ] != "examples" :
0 commit comments