|
1 | | -# bs-python |
2 | | -What is this all about? So we we wanted something like kmkPython But after talking with the kmk team and hearing the challanges we thought we would start fresh. So welcome to BS_Python (pun very much intended) our version of KMKPython. |
3 | | - |
4 | | -So the main idea here and how we are doing this defferently is we as you can see dont have circuit_python in here. What we do is we script everything. We start by cloning circuit_python > check out the right branch > make all the code changes > build the boards |
5 | | - |
6 | | -Let me break down whats going on and how you can use this. I will start by going over the code flow then I will tell you what you need to edit (if you need to edit anything) and how you can help out |
7 | | - |
8 | | -## Code flow |
9 | | -* scipts/build.sh <- enetry point |
10 | | - * calls main.py |
11 | | - * main.py <- start of the code |
12 | | - * cpy_git <- handles all things to do with git |
13 | | - * clone the repo |
14 | | - * add submodules |
15 | | - * misc_file_changes <- change cpy code |
16 | | - * board_mapping <- this moves BS_python boards into the right place in cpy |
17 | | - * builds docker container |
18 | | - * that way you only need docker and python you dont need to make sure you can compile cpy |
19 | | -* scripts/start.sh |
20 | | - * starts the newly built docker container and builds all of the BS_python boards |
21 | | - |
22 | | -Ok now that you have an idea on how this flows together lets go over some things you might do and how you would go about doing them. |
23 | | - |
24 | | -## Freez xyz lib into xyz board and let everyone download that |
25 | | -So you will want to copy that board from the cpy folder (run main.py to get that). Then make your changes to it and place that into the ./bs_python_boards folder. Now Its very important you place it in the correct foleder. When you take it from the cpy repo if it is from ports/nrf it needs to go into the nrf folder. If the folder does not exsist just make it but it NEEDS to be spelled the same. |
26 | | - |
27 | | -## Freez a lib that is not in CPY |
28 | | -To freez a another libary you can simply add it to the FROZEN_REPO_LIST in cpy_git.py |
29 | | - |
30 | | -## other code changes |
31 | | -Above is all that I have implmented But if you want to make random changes to the CPY code base feel free to do so. A few things I would like to ask of you. Make sure that the entry for your code is in misc_file_changes.py (unless another file is better eg: git changes should be in cpy_git.py). And make sure you add somthing to this file letting other know how to do your cool new change. |
32 | | - |
33 | | -## TODO / HELP WANTED / DISCLAMER |
34 | | - |
35 | | -* Add some boards |
36 | | -* freez in kmk in some way. But I want it compiled to .mpy |
37 | | -* I am a super python noob I barly know how to setup a python project. This one was setup using pipenv and python 3.9.x we dont have a reqerments.txt I dont know how to make one or if we need one we do have a pipfile tho. |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
| 1 | +# BS-Python |
| 2 | +What is this all about? So we wanted something like kmkPython But after talking with the kmk team and hearing the challenges we thought we would start fresh. So welcome to BS_Python (pun very much intended) our version of KMKPython. |
| 3 | + |
| 4 | +So the main idea here and how we are doing this differently is we as you can see dont have circuit_python in here. What we do is we script everything. We start by cloning circuit_python > check out the right branch > make all the code changes > build the boards |
| 5 | + |
| 6 | +Let me break down what's going on and how you can use this. I will start by going over the code flow then I will tell you what you need to edit (if you need to edit anything) and how you can help out |
| 7 | + |
| 8 | +## Quick links |
| 9 | +[current boards](supported_boards.md) |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## **important** |
| 14 | +All scripts are intended to be run from the root so |
| 15 | + |
| 16 | +**dont** do this |
| 17 | +``` |
| 18 | +cd scripts |
| 19 | +bash start.sh |
| 20 | +``` |
| 21 | +**do** do this |
| 22 | +``` |
| 23 | +bash scripts/start.sh |
| 24 | +``` |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +## Code flow |
| 29 | +* scipts/start.sh <- enetry point |
| 30 | + * calls main.py |
| 31 | + * main.py <- start of the code |
| 32 | + * cpy_git <- handles all things to do with git |
| 33 | + * clone the repo |
| 34 | + * add submodules |
| 35 | + * misc_file_changes <- change cpy code |
| 36 | + * board_mapping <- this moves BS_python boards into the right place in cpy |
| 37 | + * genarates the build script and post build script |
| 38 | + * pulls the docker container or uses the one you build (see below) |
| 39 | + * starts the new docker container |
| 40 | + * runs the dockersetupcmd.sh |
| 41 | + * this sets up the cloned cpy repo for building |
| 42 | + * runs the genarated build script that builds all the BS_Python boards |
| 43 | + * runs the genarated post build script |
| 44 | + * this moves all of the built .u2f files into the ./build_out and renames them |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +## Misc things you can do |
| 49 | +below are the other scripts you can run and what they do |
| 50 | +* scripts/build.sh |
| 51 | + * builds docker container |
| 52 | + * that way you only need docker and python you don't need to make sure you can compile cpy |
| 53 | + * tries to push it as well. |
| 54 | +* scripts/clean.sh |
| 55 | + * removes old cpy clones and builds. |
| 56 | +* scripts/bash-container.sh |
| 57 | + * this is mostly for debugging the docker container |
| 58 | + * it dumps you into bash on the container so you can see what's going on in there |
| 59 | +* scripts/kill-all.sh |
| 60 | + * kills all docker containers running (look out) |
| 61 | + |
| 62 | +Ok now that you have an idea on how this flows together lets go over some things you might do and how you would go about doing them. |
| 63 | + |
| 64 | +## Freez xyz lib into xyz board and let everyone download that |
| 65 | +So you will want to copy that board from the cpy folder (run main.py to get that). Then make your changes to it and place that into the ./bs_python_boards folder. Now Its very important you place it in the correct folder. When you take it from the cpy repo if it is from ports/nrf it needs to go into the nrf folder. If the folder does not exist just make it but it NEEDS to be spelled the same. |
| 66 | + |
| 67 | +## Freez a lib that is not in CPY |
| 68 | +To freez another library you can simply add it to the FROZEN_REPO_LIST in cpy_git.py |
| 69 | + |
| 70 | +## other code changes |
| 71 | +Above is all that I have implemented But if you want to make random changes to the CPY code base feel free to do so. A few things I would like to ask of you. Make sure that the entry for your code is in misc_file_changes.py (unless another file is better eg: git changes should be in cpy_git.py). And make sure you add something to this file letting others know how to do your cool new change. |
| 72 | + |
| 73 | +## TODO / HELP WANTED / DISCLAMER |
| 74 | +* typo / spelling |
| 75 | +* let me know if I need to make any more changes to stay legal |
| 76 | +* Add some boards |
| 77 | +* turn all my sick bash scripts into a make file LOL |
| 78 | +* freez in kmk in some way. But I want it compiled to .mpy |
| 79 | +* I am a super python noob I barely know how to setup a python project. This one was setup using pipenv and python 3.9.x we dont have a reqerments.txt I dont know how to make one or if we need one we do have a pipfile tho. |
| 80 | +* github action to add all the .uf2s from ./build_out to git hub releases |
| 81 | +* add colors to the logs (just the python parts) |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
0 commit comments