-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add make target python-requirements
to install Python requirements of project
#2019
Add make target python-requirements
to install Python requirements of project
#2019
Conversation
@aemseemann Let's split this PR. Move all stuff related to the configuration of the python interpreter into a separate PR (for example: feature/config-python-interpreter). And then rebase this PR on top of the feature/config-python-interpreter PR.
What will happen if a component has example that requires python modules, but Sming and the current project itself do not require it? Do we have to explicitly list all requirements.txt files or what would you suggest? |
Instead of explicitly invoking |
@slaff: for the PYTHON config PR see #2022 .
(Hope I understood your question correctly) The make target is supposed to install the python requirements of the Sming project it is invoked on. The requirements.txt of all Components/libraries directly or indirectly consumed by the project are collected, either by autodetecting a If a library/Component comes with an example project ('example' subdir in tree below), its Python requirements are irrelevant for the project consuming the library/Component and hence are not installed. Sming/Libraries/MyLib |
@mikee47: There are too many ways the user might want to manage its python installation. Some users might be fine with a user/system wide installation. Some might prefer a virtualenv (for this project only or shared with other Sming working copies...). Others might want to use Distro packages instead of pip. For the latter kind, it might be helpful to add another target to just dump all the requirements.txt files relevant for the project. <-- Edit: done with commit bb48e01: |
I tried to add a |
2987dda
to
51fa858
Compare
Sming/project.mk
Outdated
@@ -160,6 +163,7 @@ COMPONENT_VARS := | |||
COMPONENT_RELINK_VARS := | |||
COMPONENT_TARGETS := | |||
COMPONENT_DEPENDS := | |||
override undefine COMPONENT_PYTHON_REQUIREMENTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work with MinGW. Why not just COMPONENT_PYTHON_REQUIREMENTS :=
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Specifically, undefine
not supported in GNU Make 3.81)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference between an undefined vs. an empty COMPONENT_PYTHON_REQUIREMENTS
is auto detection of 'requirements.txt', i.e. in the empty case no auto-detection is performed.
In the latest commit, I moved auto-detection before component evaluation. This way, the component can simply clear the variable if it wishes to suppress an auto-detected requirements.txt
. No undefine
necessary & successfully tested with make 3.81.
Sming/project.mk
Outdated
@@ -184,6 +188,11 @@ CMP_$1_LIBNAME := $$(COMPONENT_LIBNAME) | |||
CMP_$1_INCDIRS := $$(COMPONENT_INCDIRS) | |||
CMP_$1_DEPENDS := $$(COMPONENT_DEPENDS) | |||
CMP_$1_RELINK_VARS := $$(COMPONENT_RELINK_VARS) | |||
ifeq ($$(origin COMPONENT_PYTHON_REQUIREMENTS),undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and ifndef COMPONENT_PYTHON_REQUIREMENTS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would have much clearer, but no longer necessary.
ff18455
to
23f9e68
Compare
@mikee47: The Travis build failure seems to be related to the install step of the python requirements for building the docs. Unfortunately I do not understand what the actual problem is. Can you shed some light on what's going on there? (If I remember correctly, it's not the first time I encounter this error, but it always disappeared when triggering another build.) |
23f9e68
to
63d2b50
Compare
@aemseemann Checking back through the logs the |
63d2b50
to
2e6bcb5
Compare
@aemseemann I appear to be able to push commits directly to your branch... that was initially by accident but hope it's OK to do it here? |
Various things but key ones are: * Updating pip3 version * Adding 'wheel' and 'cairocffi' packages
2e6bcb5
to
50d0a8d
Compare
@mikee47: No problem for pushing directly to the branch, but it is quite strange indeed. I cannot see any setting that would allow this. EDIT: It's not that strange after all: By ticking "Allow edits from maintainers" for this PR I've granted push permissions to anyone with write access to the upstream repository. |
@aemseemann @mikee47 What is the state of this PR? |
This is a proposal to add a new
make
target to installs all python requirements of the project from 'requirements.txt' files of the Components it depends on.Open tasks I would like to collect some feedback first:
python-requirements
for every sample is quite slow, it's probably best to explicitly invoke it only for those samples known to have non-standard python requirements.