dist/tools/bmp: in-line dependencies using PEP 723#21131
dist/tools/bmp: in-line dependencies using PEP 723#21131maribu merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
While I like the idea of getting rid of separate |
|
I think we can just drop the |
|
Yes, the As a Python developer, I would be fine with it. |
|
OK, if t here is an actual benefit of keeping the |
|
@mguetschow I have added a comment to the |
|
I think this is only missing the rebase to get in |
PEP 723 is an accepted proposal to in-line script metadata. One such
use cases is to put script dependencies inside the script, which makes
the requirements.txt redundant [1].
With the correct shebang, it becomes even possible to run the script
directly, without creating a virtual environment and installing
dependencies in advance.
Combining both makes the execution of single-file scripts within RIOT
much easier and friendlier.
PEP 723 metadata can be used by `pipx` [2] and can be easily
installed when `pip` is available.
[1] `pip install` still requires a requirements.txt, which is
generally accepted during development. An open issue exists to
add support for reading dependencies from PEP 723 as well. See
pypa/pip#12891
[2] https://github.com/pypa/pipx
|
Squashed and rebased. |
|
FYI: PIP 26.0 now supports installing dependencies from the script metadata block inside a script. That means that |
|
Nice! Would you mind to open a cleanup PR to drop the |
Contribution description
PEP 723 is an accepted proposal to in-line script metadata. One such use cases is to list script dependencies inside the script, which makes the
requirements.txtredundant.With the correct shebang, it becomes even possible to run the script directly, without creating a virtual environment and installing dependencies in advance. Combining both makes the execution of single-file scripts within RIOT much easier and friendlier.
PEP 723 metadata can be used by
pipxand can be easily installed whenpipis available. It is maintained by the PyPA, just likepip.I chose this file to start with, but there are at least five more scripts with
requirements.txtthat could benefit from the same change. Becausepip installstill requires arequirements.txtfile, which is generally accepted during development, I kept both for now. An open issue exists to add support for reading dependencies from PEP 723, which might make it superfluous in the future.Testing procedure
Ensure that
pipxis installed.This script is part of the Black Magic Debugger. Execute it from the
dist/tools/bmpfolder, or compile any application and usePROGRAMMER=bmpto execute it from the build process.Issues/PRs references
None