-
Notifications
You must be signed in to change notification settings - Fork 116
Fix issue with run_setup and dronecan #228
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
base: main
Are you sure you want to change the base?
Conversation
|
Brilliant - confirming it worked for me on MacOS. |
|
oh my gosh ... that's really above my head ... and since I guess I have to maintain that scrupt "scares" me ... |
|
Hmmm, this is actually an unusual way of doing it, but it keeps it all in a python script, and keeps it cross-platform. I guess other option is to replace to run_setup.py with run_setup.bat(windows) and run_setup.sh(linux mac). These shell scripts can install the dronecan dependencies and run the other python scripts, that would be the more common way of doing it. Last option is to just document the installation steps for the 4 python dependencies before running run_setup.py and let devs do it themselves. I think you still need to setup python virtual environment for this, the more recent versions of python seem to increasingly severe warnings on system-wide dependency installation. |
|
@tmcadam One question though I find confusing: |
|
It looks like a windows mac/linux thing. I can't remember but likely I was using linux when I created this PR. |
Hyperion218
left a comment
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.
During initialization of mLRS repo on my computers (windows & linux), I stumbled on the same issue that this PR resolve.
I've added a small change proposition that should resolve OS specific weirdness on folder names.
| script_folder = pathlib.Path(__file__).parent.resolve() | ||
| venv_folder = os.path.join(script_folder, 'venv') | ||
| venv.create(venv_folder, with_pip=True) | ||
| python_path = os.path.join(venv_folder, "bin", "python") |
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.
To resolve the issue of differents folder name containing python between Unix/MAC and Windows OS, same-ish code as in the original virtualenv commit (here) can be used.
| python_path = os.path.join(venv_folder, "bin", "python") | |
| bin_dir = "bin" | |
| if sys.platform == 'win32': | |
| bin_dir = "Scripts" | |
| python_path = os.path.join(venv_folder, bin_dir, "python") |
This is very rough, but demonstrates a fix for the issue with dronecan failing in run_setup.py
ONLY TESTED ON LINUX!