build: Create py files from jupyter notebooks
This commit is contained in:
parent
aa5f7c63b5
commit
3532695ae1
2 changed files with 8 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,2 +1,4 @@
|
|||
*.mpy
|
||||
*.py
|
||||
.ipynb_checkpoints
|
||||
__pycache__
|
||||
|
|
|
|||
6
Makefile
6
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue