Skip to content

Commit

Permalink
Allow any ".bin" file to be shipped in a circuitpython package
Browse files Browse the repository at this point in the history
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
`````
  • Loading branch information
jepler committed Nov 29, 2023
1 parent 34c259d commit 6de3690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions circuitpython_build_tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import tempfile

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

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

0 comments on commit 6de3690

Please sign in to comment.