-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dist/tools/bmp: in-line dependencies using PEP 723 #21131
base: master
Are you sure you want to change the base?
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 |
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
@mguetschow I have added a comment to 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.txt
redundant.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
and can be easily installed whenpip
is 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.txt
that could benefit from the same change. Becausepip install
still requires arequirements.txt
file, which is generally accepted during development, I kept both for now. Aan open issue exists to add support for reading dependencies from PEP 723, which might make it superfluous in the future.Testing procedure
Ensure that
pipx
is installed.Alternatively, execute it from the
dist/tools/bmp
folder.This script is part of the Black Magic Debugger. Execute it from the
dist/tools/bmp
folder, or compile any application and usePROGRAMMER=bmp
to execute it from the build process.Issues/PRs references
None