Skip to content

Commit f854e34

Browse files
committed
Switch first-time-setup to skip pipenv. Old pipenv setup is deprecated to tools directory as an optional path
1 parent ee29a37 commit f854e34

File tree

4 files changed

+58
-57
lines changed

4 files changed

+58
-57
lines changed

first-time-setup.sh

+5-56
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,9 @@
11
#!/bin/bash
22

3-
sudo apt-get update -y
4-
5-
sudo apt-get install -y make \
6-
build-essential \
7-
llvm \
8-
libssl-dev \
9-
bzip2 \
10-
zlib1g-dev \
11-
libbz2-dev \
12-
libreadline6 \
13-
libreadline-dev \
14-
libsqlite3-dev \
15-
libncurses5-dev \
16-
libncursesw5-dev \
17-
xz-utils \
18-
tk-dev \
19-
libffi-dev \
20-
liblzma-dev
21-
22-
pip3 install pipenv
23-
24-
# Reload ~/.profile. In recent Raspberry Pi OS releases, this automatically includes $HOME/.local/bin in the path once it exists.
25-
source ~/.profile
26-
27-
# Test whether pipenv is in the system path now
28-
if ! which pipenv ; then
29-
# It's not in the path, so we should add it on boot
30-
printf "\n# Add $HOME/.local/bin to PATH for pipenv.\n# This was automatically added by Sphero RVR SDK first-time-setup.sh\n" >> ~/.profile
31-
printf "PATH=\"\$HOME/.local/bin:\$PATH\"\n" >> ~/.profile
32-
33-
# Apply the ~/.profile update to this session as well
34-
source ~/.profile
35-
fi
36-
37-
python3 -m pipenv --python /usr/bin/python3.7
38-
39-
# The cryptography package is a dependency, but for some reason pipenv can't always install it correctly, so we'll use pip instead. ¯\_(ツ)_/¯
40-
python3 -m pipenv run pip install cryptography
41-
42-
python3 -m pipenv install
43-
44-
while true; do
45-
read -ep $'By default, the RVR SDK uses the UART on /dev/ttys0 to communicate with RVR.\nDo you have Serial Port enabled and Serial Shell disabled in Raspberry Pi Configuration?\n(y/n):' yn
46-
case $yn in
47-
[Yy]* ) exit;;
48-
[Nn]* )
49-
read -p $'Would you like to open the command line raspi-config tool now to change these settings?\nYou can do this at any time with \'sudo raspi-config\'\n(y/n):' yn2
50-
case $yn2 in
51-
[Yy]* ) sudo raspi-config; break;;
52-
[Nn]* ) exit;;
53-
* ) echo "Please answer yes or no.";;
54-
esac
55-
break;;
56-
* ) echo "Please answer yes or no.";;
57-
esac
58-
done
3+
# This script guides a user through setting up the Sphero RVR Python SDK.
594

5+
# Install the SDK dependencies
6+
pip3 install -r requirements.txt
607

8+
# Provide an opportunity to correct the UART settings if needed.
9+
./tools/pi-uart-check.sh

first-time-simple-setup.sh

-1
This file was deleted.

tools/pi-uart-check.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# This script guides a user through setting up the Sphero RVR Python SDK.
4+
5+
# Install the SDK dependencies
6+
pip3 install -r requirements.txt
7+
8+
./tools/pi-uart-check.sh

tools/pipenv-setup.sh

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
sudo apt-get update -y
4+
5+
sudo apt-get install -y make \
6+
build-essential \
7+
llvm \
8+
libssl-dev \
9+
bzip2 \
10+
zlib1g-dev \
11+
libbz2-dev \
12+
libreadline6 \
13+
libreadline-dev \
14+
libsqlite3-dev \
15+
libncurses5-dev \
16+
libncursesw5-dev \
17+
xz-utils \
18+
tk-dev \
19+
libffi-dev \
20+
liblzma-dev
21+
22+
pip3 install pipenv
23+
24+
# Reload ~/.profile. In recent Raspberry Pi OS releases, this automatically includes $HOME/.local/bin in the path once it exists.
25+
source ~/.profile
26+
27+
# Test whether pipenv is in the system path now
28+
if ! which pipenv ; then
29+
# It's not in the path, so we should add it on boot
30+
printf "\n# Add $HOME/.local/bin to PATH for pipenv.\n# This was automatically added by Sphero RVR SDK first-time-setup.sh\n" >> ~/.profile
31+
printf "PATH=\"\$HOME/.local/bin:\$PATH\"\n" >> ~/.profile
32+
33+
# Apply the ~/.profile update to this session as well
34+
source ~/.profile
35+
fi
36+
37+
python3 -m pipenv --python /usr/bin/python3.7
38+
39+
# The cryptography package is a dependency, but for some reason pipenv can't always install it correctly, so we'll use pip instead. ¯\_(ツ)_/¯
40+
python3 -m pipenv run pip install cryptography
41+
42+
python3 -m pipenv install
43+
44+
# Provide an opportunity to correct the UART settings if needed.
45+
./pi-uart-check.sh

0 commit comments

Comments
 (0)