Feature: Add $MDSPLUS_DIR/python to PYTHONPATH in etc/envsyms - #3074
Feature: Add $MDSPLUS_DIR/python to PYTHONPATH in etc/envsyms#3074WhoBrokeTheBuild wants to merge 2 commits into
Add $MDSPLUS_DIR/python to PYTHONPATH in etc/envsyms#3074Conversation
This removes the long-broken `MDSPLUS_SETUP_PY` and instead adds `$MDSPLUS_DIR/python` to the `PYTHONPATH` in `$MDSPLUS_DIR/etc/envsyms`. This should allow users to `import MDSplus` in python after an install with no additional setup
Since MDSplus is now on the PYTHONPATH by default, we're able to test importing during the install tests
c4fee27 to
0baa58e
Compare
mwinkel-dev
left a comment
There was a problem hiding this comment.
Simple change. Looks good. Approving this because I'm assuming Jenkins will rebuild it.
Note though that one of the "Test Packages" tests failed because it returned exit status 42.
dgarnier
left a comment
There was a problem hiding this comment.
I agree this is consistent with the current use of PYTHONPATH and MDSplus. However, I'm not a huge fan of this whole mechanism and at OpenStar we are doing something entirely different and explicitly not relying on PYTHONPATH.. preferring to use venv based solutions (see my request to have MDSplus build its own wheel during the install instead).
This change would effectively just have me modify our environment to take it back out... so I'm not a fan of this change.
|
For what it's worth Darren I agree, there's a reason I haven't implemented this in all the years we've been fighting with the python package install. You can see the discussions in the discord that lead to this PR being submitted. I'm also not a fan of the wheel solution because it (as I understand it) places a copy of the python files in the venv rather than pointing to the Then there's the additional issues of trying to modify the default python environment on install, and while users can absolutely setup a venv I would really like With some effort, I could probably get |
Oh. That gives me an idea. Let me see if it works. I think a wheel can be made that does just what you want.. just installs a .pth that points to $MDSPLUS_DIR/python (or the absolute install directory which is probably actually what we want. I'll send a PR if it works. |
This removes the long-broken
MDSPLUS_SETUP_PYand instead adds$MDSPLUS_DIR/pythonto thePYTHONPATHin$MDSPLUS_DIR/etc/envsyms.This should allow users to
import MDSplusin python after an install with no additional setupAlso add
import MDSplussteps to the installer tests