Skip to content

Commit 6de3690

Browse files
committed
Allow any ".bin" file to be shipped in a circuitpython package
This will allow e.g., 5x8.bin & ov5640_autofocus.bin within bundles. the behavior of bundlefly and circup when encountering .bin files needs to be checked. Tested by building modified pycamera bundle and the autofocus.bin file appears in the generated zip files: ````` pycamera-py-ec67bde/lib/adafruit_pycamera/ov5640_autofocus.bin 4077 4096 pycamera-8.x-mpy-ec67bde/lib/adafruit_pycamera/ov5640_autofocus.bin 4077 4096 pycamera-9.x-mpy-ec67bde/lib/adafruit_pycamera/ov5640_autofocus.bin 4077 4096 `````
1 parent 34c259d commit 6de3690

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

circuitpython_build_tools/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import tempfile
3838

3939
IGNORE_PY = ["setup.py", "conf.py", "__init__.py"]
40-
GLOB_PATTERNS = ["*.py", "font5x8.bin"]
40+
GLOB_PATTERNS = ["*.py", "*.bin"]
4141
S3_MPY_PREFIX = "https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross"
4242

4343
def version_string(path=None, *, valid_semver=False):
@@ -283,7 +283,7 @@ def library(library_path, output_directory, package_folder_prefix,
283283
_munge_to_temp(full_path, temp_file, library_version)
284284
temp_filename = temp_file.name
285285
# Windows: close the temp file before it can be read or copied by name
286-
if not mpy_cross or os.stat(full_path).st_size == 0:
286+
if not mpy_cross or os.stat(full_path).st_size == 0 or not full_path.endswith(".py"):
287287
output_file = os.path.join(output_directory,
288288
filename.relative_to(library_path))
289289
shutil.copyfile(temp_filename, output_file)

0 commit comments

Comments
 (0)