-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
cmake: locally install pip dependencies #1984
Conversation
I guess it's a question of preference. I am personally not a big fan of having CMake do custom things: when I run CMake as a user, I don't want it to install stuff on my computer and alter the I can tolerate the part that runs So yeah, I think this goes too far for me 🙈, as it is one more step towards more and more completely non-CMake stuff creeping into the CMakeLists. Again that's personal, but my bar for considering that a build system has "too much custom stuff to be trusted" is pretty low 😅. Quite often it's faster for me to just do the stuff manually than to convince myself that the script I'm told to run won't mess up my system. |
@JonasVautherin I agree in general but it is only installing it locally in the build directory, and the PYTHONPATH is only set for that call. |
Sure. It just makes the CMakeLists look weird, and I need to review it carefully to convince myself that it only does that. But on the other hand, the project won't extend so the CMakeLists should not grow more... maybe it's worth it indeed 👍. |
@JonasVautherin I see what you mean. I too would like the CMakeLists.txt as simple as possible. And cmake downloading stuff is always an unpleasant surprised. However, we're a bit in middle ground here. On the one hand we are using Python libraries locally (from the submodule) while on the other hand, we are requiring modules installed in the system (or env). A pip install would be cleaner. I don't actually understand why we have to have the submodule.
|
@JonasVautherin let's discuss whether the submodule makes sense still in the next dev call. And then based on that outcome we continue here. |
@JonasVautherin I started working on a branch that doesn't require the submodule but got stuck on this: ArduPilot/pymavlink#813 |
@julianoes Are you aware that the pip module on PyPi is not kosher? Specifically, it is built from the ArduPilot fork of MAVLink which may be ahead of ArduPilotMega.xml on mavlink/mavlink and is a subset of common.xml? Doesn't that mean this is only workable if we can have a "vanilla" pymavlink that reflects common.xml as used by mavlink/mavlink? From the discussion, I see this as not ready to merge. Let me know when you have reached a consensus and we should get Peter Barker in for review too. |
README.md
Outdated
@@ -22,8 +22,6 @@ sudo apt install python3-pip | |||
# Clone mavlink into the directory of your choice | |||
git clone https://github.com/mavlink/mavlink.git --recursive | |||
cd mavlink | |||
|
|||
python3 -m pip install pymavlink/requirements.txt |
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.
This is the "not using cmake" path. Don't we still need this instruction then?
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 requirements are installed as part of the cmake build.
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.
Oh, now I understand what you mean.
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.
Fixed, and rebased.
@hamishwillee: for me it can be merged like this. This PR is not about using pymavlink from pip, which would be another PR, I would say. |
Signed-off-by: Julian Oes <julian@oes.ch>
c2b3ab4
to
9ba0f8d
Compare
Thanks. This looks sane. I am sure you have both tested thoroughly. |
1 similar comment
Thanks. This looks sane. I am sure you have both tested thoroughly. |
This would be a way to locally install the pip dependencies automatically. This way we don't need to get them separately. I don't have a strong opinion. Requiring the dependencies explicitly manually would also be ok.