diff --git a/.gitignore b/.gitignore index 0623456..cf627a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.mpy +*.py +.ipynb_checkpoints __pycache__ diff --git a/Makefile b/Makefile index e6f8a9f..7c21c03 100644 --- a/Makefile +++ b/Makefile @@ -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