build: Create py files from jupyter notebooks

This commit is contained in:
Laborratte5 2024-05-03 12:34:49 +02:00
parent aa5f7c63b5
commit 3532695ae1
Signed by: Laborratte5
GPG key ID: 3A30072E35202C02
2 changed files with 8 additions and 0 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
*.mpy
*.py
.ipynb_checkpoints
__pycache__

View file

@ -7,6 +7,11 @@ AMPY = $(VENV) ampy --port $(ESP_PORT)
MICRO_PYTHON_FIRMWARE = ESP8266_GENERIC-20240222-v1.22.2.bin
ESP_PORT = /dev/ttyUSB0
src/%.py: src/%.ipynb
$(VENV) jupyter nbconvert --to python $? \
--TagRemovePreprocessor.enabled=True \
--TagRemovePreprocessor.remove_cell_tags remove_cell
src/%.mpy: src/%.py
@for f in $(filter-out src/main.py,$?); do \
echo Compile $$f; \
@ -40,6 +45,7 @@ clean:
rm -rf src/__pycache__
rm -f src/*.pyc
rm -f src/*.mpy
rm -f src/*.py
env:
poetry install