From a7c805cc3750a2b37d35a50c36acd98b19ec98e2 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Thu, 13 Nov 2025 02:42:14 +0100 Subject: [PATCH] mip: Optimize _CHUNK_SIZE const for code size. 17 bytes reduced. Signed-off-by: Jos Verlinde --- micropython/mip/manifest.py | 2 +- micropython/mip/mip/__init__.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/micropython/mip/manifest.py b/micropython/mip/manifest.py index 9fb94ebcb..a1b340670 100644 --- a/micropython/mip/manifest.py +++ b/micropython/mip/manifest.py @@ -1,4 +1,4 @@ -metadata(version="0.4.1", description="On-device package installer for network-capable boards") +metadata(version="0.4.2", description="On-device package installer for network-capable boards") require("requests") diff --git a/micropython/mip/mip/__init__.py b/micropython/mip/mip/__init__.py index 7c0fb4d3a..ab48393d6 100644 --- a/micropython/mip/mip/__init__.py +++ b/micropython/mip/mip/__init__.py @@ -1,13 +1,14 @@ # MicroPython package installer # MIT license; Copyright (c) 2022 Jim Mussared -from micropython import const -import requests import sys +import requests + +from micropython import const _PACKAGE_INDEX = const("https://micropython.org/pi/v2") -_CHUNK_SIZE = 128 +_CHUNK_SIZE = const(128) allowed_mip_url_prefixes = ("http://", "https://", "github:", "gitlab:")