Can't freeze __init.py__

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

Can't freeze __init.py__

Post by bradstew » Tue Sep 07, 2021 3:47 am

Hi,
I am trying to freeze some code.
Board is a modified pyboard using a STM32F405

It works fine if I do not include __init.py__ in the manifest.

Here is my manifest file:

Code: Select all

include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/display", ("lcd160cr.py", "lcd160cr_test.py"))
freeze("$(MPY_DIR)/drivers/onewire", "onewire.py")
freeze("$(MPY_DIR)/CubScout_Frozen/modes",("__init.py__","normal.py","setup.py","test.py"))
#include("$(MPY_DIR)/CubScout_Frozen/modes/manifest.py")
I tried both methods using "freeze" and "#include" and get similar errors.
Here's the output from the build using "freeze" function in the manifest:

Code: Select all

brad@ubuntu:~/project/micropython/ports/stm32$ make BOARD=CUBSCOUT2
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
warn: unsupported file type, skipped freeze: __init.py__
brad@ubuntu:~/project/micropython/ports/stm32$ 
If I simply remove the "__init.py__", it will build.
I even tried with "__init.py__" containing only comments.

I followed the example for uasychio which also has an " __init.py__" file listed in the manifest and no problems.
I check the file permissions and they seem OK and consistent with the other modules in the release build.

Code: Select all

brad@ubuntu:~/project/micropython/CubScout_Frozen/modes$ ls -al
total 48
drwxrwxr-x 2 brad brad  4096 Sep  6 20:21 .
drwxrwxr-x 3 brad brad  4096 Sep  6 20:15 ..
-rw-rw-r-- 1 brad brad   347 Sep  6 19:58 __init__.py
-rw-r--r-- 1 brad brad   277 Sep  6 20:21 manifest.py
-rw-rw-r-- 1 brad brad 12686 Sep  2 11:02 normal.py
-rw-rw-r-- 1 brad brad  4796 Aug 26 14:30 setup.py
-rw-rw-r-- 1 brad brad  8035 Aug 30 14:18 test.py
brad@ubuntu:~/project/micropython/CubScout_Frozen/modes$ 
Any ideas of what I'm doing wrong?

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Can't freeze __init.py__

Post by kevinkk525 » Tue Sep 07, 2021 4:53 am

Simple oversight but "__init.py__" is a wrong file name. It should be "__init__.py"
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

Re: Can't freeze __init.py__

Post by bradstew » Tue Sep 07, 2021 5:14 pm

Well. This is embarrassing. :oops:
Thanks for pointing this out. Sometimes you can't see the forest from the trees...

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Can't freeze __init.py__

Post by kevinkk525 » Tue Sep 07, 2021 7:20 pm

bradstew wrote:
Tue Sep 07, 2021 5:14 pm
Thanks for pointing this out. Sometimes you can't see the forest from the trees...
Indeed and that can take half a day. So always good to ask, saves a lot of time. Similar things happened to me too :D
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply