|
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_blocklist = 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 | 40 | if sys.version_info >= (3, 11): |
59 | 41 | from tomllib import loads as load_toml |
@@ -194,12 +176,6 @@ def get_package_info(library_path, package_folder_prefix): |
194 | 176 | py_modules = get_nested(pyproject_toml, "tool", "setuptools", "py-modules", default=[]) |
195 | 177 | packages = get_nested(pyproject_toml, "tool", "setuptools", "packages", default=[]) |
196 | 178 |
|
197 | | - blocklisted = [name for name in py_modules if name in pyproject_py_modules_blocklist] |
198 | | - |
199 | | - if blocklisted: |
200 | | - print(f"{lib_path}/settings.toml:1: {blocklisted[0]} blocklisted: not using metadata from pyproject.toml") |
201 | | - py_modules = packages = () |
202 | | - |
203 | 179 | example_files = [sub_path for sub_path in (lib_path / "examples").rglob("*") |
204 | 180 | if sub_path.is_file()] |
205 | 181 |
|
@@ -227,29 +203,7 @@ def get_package_info(library_path, package_folder_prefix): |
227 | 203 | py_files = [lib_path / f"{py_module}.py"] |
228 | 204 |
|
229 | 205 | else: |
230 | | - print(f"{lib_path}: Using legacy autodetection") |
231 | | - package_info["is_package"] = False |
232 | | - for file in glob_search: |
233 | | - if file.parts[parent_idx] != "examples": |
234 | | - if len(file.parts) > parent_idx + 1: |
235 | | - for prefix in package_folder_prefix: |
236 | | - if file.parts[parent_idx].startswith(prefix): |
237 | | - package_info["is_package"] = True |
238 | | - if package_info["is_package"]: |
239 | | - package_files.append(file) |
240 | | - else: |
241 | | - if file.name in IGNORE_PY: |
242 | | - #print("Ignoring:", file.resolve()) |
243 | | - continue |
244 | | - if file.parent == lib_path: |
245 | | - py_files.append(file) |
246 | | - |
247 | | - if package_files: |
248 | | - package_info["module_name"] = package_files[0].relative_to(library_path).parent.name |
249 | | - elif py_files: |
250 | | - package_info["module_name"] = py_files[0].relative_to(library_path).name[:-3] |
251 | | - else: |
252 | | - package_info["module_name"] = None |
| 206 | + raise ValueError("Must specify exactly one of tool.setuptools.py-modules or .packages") |
253 | 207 |
|
254 | 208 | if len(py_files) > 1: |
255 | 209 | raise ValueError("Multiple top level py files not allowed. Please put " |
|
0 commit comments