@@ -56,24 +56,6 @@ def git_filter_arg():
5656 else :
5757 return []
5858
59- # pyproject.toml `py_modules` values that are incorrect. These should all have PRs filed!
60- # and should be removed when the fixed version is incorporated in its respective bundle.
61-
62- pyproject_py_modules_blocklist = set ((
63- # adafruit bundle
64- "adafruit_colorsys" ,
65-
66- # community bundle
67- "at24mac_eeprom" ,
68- "circuitpython_Candlesticks" ,
69- "CircuitPython_Color_Picker" ,
70- "CircuitPython_Equalizer" ,
71- "CircuitPython_Scales" ,
72- "circuitPython_Slider" ,
73- "circuitpython_uboxplot" ,
74- "P1AM" ,
75- "p1am_200_helpers" ,
76- ))
7759
7860if sys .version_info >= (3 , 11 ):
7961 from tomllib import loads as load_toml
@@ -216,12 +198,6 @@ def get_package_info(library_path, package_folder_prefix):
216198 py_modules = get_nested (pyproject_toml , "tool" , "setuptools" , "py-modules" , default = [])
217199 packages = get_nested (pyproject_toml , "tool" , "setuptools" , "packages" , default = [])
218200
219- blocklisted = [name for name in py_modules if name in pyproject_py_modules_blocklist ]
220-
221- if blocklisted :
222- print (f"{ lib_path } /settings.toml:1: { blocklisted [0 ]} blocklisted: not using metadata from pyproject.toml" )
223- py_modules = packages = ()
224-
225201 example_files = [sub_path for sub_path in (lib_path / "examples" ).rglob ("*" )
226202 if sub_path .is_file ()]
227203
@@ -249,29 +225,7 @@ def get_package_info(library_path, package_folder_prefix):
249225 py_files = [lib_path / f"{ py_module } .py" ]
250226
251227 else :
252- print (f"{ lib_path } : Using legacy autodetection" )
253- package_info ["is_package" ] = False
254- for file in glob_search :
255- if file .parts [parent_idx ] != "examples" :
256- if len (file .parts ) > parent_idx + 1 :
257- for prefix in package_folder_prefix :
258- if file .parts [parent_idx ].startswith (prefix ):
259- package_info ["is_package" ] = True
260- if package_info ["is_package" ]:
261- package_files .append (file )
262- else :
263- if file .name in IGNORE_PY :
264- #print("Ignoring:", file.resolve())
265- continue
266- if file .parent == lib_path :
267- py_files .append (file )
268-
269- if package_files :
270- package_info ["module_name" ] = package_files [0 ].relative_to (library_path ).parent .name
271- elif py_files :
272- package_info ["module_name" ] = py_files [0 ].relative_to (library_path ).name [:- 3 ]
273- else :
274- package_info ["module_name" ] = None
228+ raise ValueError ("Must specify exactly one of tool.setuptools.py-modules or .packages" )
275229
276230 if len (py_files ) > 1 :
277231 raise ValueError ("Multiple top level py files not allowed. Please put "
0 commit comments