Skip to content

Commit 9fb6ffb

Browse files
committed
build_bundles: Ignore more packages that exist only on pypi
…and sort the existing list and use 'normalized' names The implementation of normalize_dist_name is taken from pipkin.
1 parent 3552198 commit 9fb6ffb

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

circuitpython_build_tools/scripts/build_bundles.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,22 @@
4040
import pkg_resources
4141

4242
BLINKA_LIBRARIES = [
43-
"adafruit-blinka",
44-
"adafruit-blinka-bleio",
45-
"adafruit-blinka-displayio",
46-
"adafruit-blinka-pyportal",
47-
"adafruit-python-extended-bus",
43+
"adafruit_blinka",
44+
"adafruit_blinka_bleio",
45+
"adafruit_blinka_displayio",
46+
"adafruit_blinka_pyportal",
47+
"adafruit_circuitpython_busdevice",
48+
"adafruit_python_extended_bus",
49+
"numpy",
50+
"pillow",
51+
"pyasn1",
4852
"pyserial",
53+
"scipy",
4954
]
5055

56+
def normalize_dist_name(name: str) -> str:
57+
return name.lower().replace("-", "_")
58+
5159
def add_file(bundle, src_file, zip_name):
5260
bundle.write(src_file, zip_name)
5361
file_size = os.stat(src_file).st_size
@@ -93,6 +101,7 @@ def get_bundle_requirements(directory, package_list):
93101
if any(operators in line for operators in [">", "<", "="]):
94102
# Remove everything after any pip style version specifiers
95103
line = re.split("[<|>|=|]", line)[0]
104+
line = normalize_dist_name(line)
96105
if line not in dependencies and line in package_list:
97106
dependencies.append(package_list[line]["module_name"])
98107
elif line not in pypi_reqs and line not in BLINKA_LIBRARIES:

0 commit comments

Comments
 (0)