Skip to content

Commit e7c30d0

Browse files
committed
remove workaround for libraries with missing metadata
1 parent 1f3c5bd commit e7c30d0

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

circuitpython_build_tools/build.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,6 @@
3636
import subprocess
3737
import tempfile
3838

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-
))
5739

5840
if sys.version_info >= (3, 11):
5941
from tomllib import loads as load_toml
@@ -194,12 +176,6 @@ def get_package_info(library_path, package_folder_prefix):
194176
py_modules = get_nested(pyproject_toml, "tool", "setuptools", "py-modules", default=[])
195177
packages = get_nested(pyproject_toml, "tool", "setuptools", "packages", default=[])
196178

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-
203179
example_files = [sub_path for sub_path in (lib_path / "examples").rglob("*")
204180
if sub_path.is_file()]
205181

@@ -227,29 +203,7 @@ def get_package_info(library_path, package_folder_prefix):
227203
py_files = [lib_path / f"{py_module}.py"]
228204

229205
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")
253207

254208
if len(py_files) > 1:
255209
raise ValueError("Multiple top level py files not allowed. Please put "

0 commit comments

Comments
 (0)