Skip to content

Commit 13d9ac7

Browse files
hofbibernatx
authored andcommitted
replace deprecated platform dist with distro linux distribution call
1 parent 0d6a2ea commit 13d9ac7

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ matrix:
2828
install:
2929
- pip2 install -q --user setuptools
3030
- pip2 install -q --user -r PythonAPI/test/requirements.txt
31+
- pip2 install -q --user -r PythonAPI/carla/requirements.txt
3132
- pip3 install -q --user setuptools
3233
- pip3 install -q --user -r PythonAPI/test/requirements.txt
34+
- pip3 install -q --user -r PythonAPI/carla/requirements.txt
3335
script:
3436
- while sleep 2m; do echo "still building..."; done &
3537
- make setup >> build.log 2>&1

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* Fixed collision issues when debug draw(debug.draw_line) is called
2929
* Fixed Gyroscope sensor to properly give angular velocity readings in local frame
3030
* Added Renderdoc plugin to the Unreal project.
31+
* Replace deprectated `platform.dist()` with recommended `distro.linux_distribution()`
3132

3233
## CARLA 0.9.9
3334

PythonAPI/carla/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
networkx
22
numpy; python_version < '3.0'
33
numpy==1.18.4; python_version >= '3.0'
4+
distro

PythonAPI/carla/setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import fnmatch
1212
import os
13-
import platform
1413
import sys
1514

1615
def is_rss_variant_enabled():
@@ -33,8 +32,9 @@ def walk(folder, file_filter='*'):
3332
yield os.path.join(root, filename)
3433

3534
if os.name == "posix":
36-
# @todo Replace deprecated method.
37-
linux_distro = platform.dist()[0] # pylint: disable=W1505
35+
import distro
36+
37+
linux_distro = distro.linux_distribution()[0]
3838
if linux_distro.lower() in ["ubuntu", "debian", "deepin"]:
3939
pwd = os.path.dirname(os.path.realpath(__file__))
4040
pylib = "libboost_python%d%d.a" % (sys.version_info.major,

Util/BuildTools/Setup.sh

+11
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,17 @@ fi
368368

369369
unset RECAST_BASENAME
370370

371+
# ==============================================================================
372+
# -- Install python requirements -----------------------------------------------
373+
# ==============================================================================
374+
375+
log "Installing python requirements"
376+
377+
pip2 install --ignore-installed --user setuptools==44.1.1
378+
pip2 install --user distro
379+
pip3 install --ignore-installed --user setuptools
380+
pip3 install --user distro
381+
371382
# ==============================================================================
372383
# -- Generate Version.h --------------------------------------------------------
373384
# ==============================================================================

0 commit comments

Comments
 (0)