Skip to content
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

Python virtual environment #3305

Merged
merged 6 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[install] Use distro instead of lsb_release.
  • Loading branch information
Fabien-B authored and Fabien-B committed Oct 14, 2024
commit 082dba8d1ec534796a362e3bbafbcbf700a897d3
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ PyQtWebEngine
pyqtgraph
unidecode
matplotlib
distro
19 changes: 9 additions & 10 deletions sw/tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

import lsb_release
import distro
import subprocess
import webbrowser

release = lsb_release.get_distro_information()
distro_version = float(distro.version())
docs = 'https://paparazzi-uav.readthedocs.io'


Expand Down Expand Up @@ -47,12 +47,12 @@ def cmd_repo(self):
def cmd_dev(self):
self.execute('sudo -E apt-get -f -y install paparazzi-dev')
# Missing
if float(release['RELEASE']) <= 20.04:
if distro_version <= 20.04:
self.execute('sudo -E apt-get install -y python3-lxml python3-numpy')

def cmd_arm(self):
self.execute('sudo -E apt-get -f -y install paparazzi-dev')
if float(release['RELEASE']) >= 20.04:
if distro_version >= 20.04:
self.execute('sudo -E apt-get install -y python-is-python3 gcc-arm-none-eabi gdb-multiarch')
# python3-serial?
else:
Expand All @@ -72,7 +72,7 @@ def cmd_mcu(self):
self.execute('sudo -E cp conf/system/udev/rules/*.rules /etc/udev/rules.d/ && sudo -E udevadm control --reload-rules')

def cmd_gazebo(self):
if float(release['RELEASE']) > 20.04:
if distro_version > 20.04:
self.execute('sudo -E apt-get -f -y install gazebo libgazebo-dev')
else:
self.execute('sudo -E apt-get -f -y install gazebo9 libgazebo9-dev')
Expand Down Expand Up @@ -106,8 +106,7 @@ def __init__(self):
QWidget.__init__(self)
mainlayout = QVBoxLayout()

os = QLabel()
os.setText("OS: " + release['ID'] + ' ' + release['RELEASE'])
os = QLabel(f"OS: {distro.name()} {distro.version()}")
os.setFont(QFont("Times", 18, QFont.Bold))
mainlayout.addWidget(os)

Expand Down Expand Up @@ -143,7 +142,7 @@ def __init__(self):
btn_layout.addWidget(button4)

button5 = QPushButton('5) Binary ground station')
if float(release['RELEASE']) < 20.04:
if distro_version < 20.04:
button5.setDisabled(True)
else:
button5.clicked.connect(self.cmd_gcs)
Expand All @@ -153,7 +152,7 @@ def __init__(self):
button6.clicked.connect(self.cmd_mcu)
btn_layout.addWidget(button6)

if float(release['RELEASE']) <= 20.04:
if distro_version <= 20.04:
button7 = QPushButton('7) Gazebo9')
else:
button7 = QPushButton('7) Gazebo11')
Expand All @@ -162,7 +161,7 @@ def __init__(self):

button8 = QPushButton('8) Bebop Opencv')
button8.clicked.connect(self.cmd_bebopcv)
if float(release['RELEASE']) > 20.04:
if distro_version > 20.04:
button8.setDisabled(True)
btn_layout.addWidget(button8)

Expand Down