Skip to content

Commit 0318c06

Browse files
committed
updates to package installation (no Drake download)
1 parent 0313b73 commit 0318c06

File tree

11 files changed

+70
-148
lines changed

11 files changed

+70
-148
lines changed

.github/workflows/pip.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ jobs:
2828
uses: actions/setup-python@v5
2929
with:
3030
python-version: '3.12'
31-
# - name: pip setup
32-
# working-directory: drake_pip
33-
# run: setup/install_prereqs
34-
# shell: zsh -efuo pipefail {0}
3531
- name: pip build and test
3632
working-directory: drake_pip
3733
run: .github/ci_build_test

.github/workflows/poetry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
python-version: '3.12'
3131
- name: poetry setup
3232
working-directory: drake_poetry
33-
run: .github/macos_setup
33+
run: setup/install_prereqs
3434
shell: zsh -efuo pipefail {0}
3535
- name: poetry build and test
3636
working-directory: drake_poetry

drake_pip/.github/ubuntu_setup

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,9 @@
33

44
set -euxo pipefail
55

6-
maybe_sudo=
7-
if [[ "${EUID}" -ne 0 ]]; then
8-
maybe_sudo=sudo
9-
fi
10-
116
echo 'APT::Acquire::Retries "4";' > /etc/apt/apt.conf.d/80-acquire-retries
127
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes
138

149
export DEBIAN_FRONTEND='noninteractive'
1510

16-
# setup/install_prereqs
17-
18-
${maybe_sudo} apt-get update
19-
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
20-
python3-all-dev
21-
python3.10-venv
22-
EOF
23-
)
11+
setup/install_prereqs

drake_pip/.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ jobs:
3939
uses: actions/setup-python@v5
4040
with:
4141
python-version: '3.12'
42-
# - name: pip setup
43-
# working-directory: drake_pip
44-
# run: setup/install_prereqs
45-
# shell: zsh -efuo pipefail {0}
4642
- name: pip build and test
4743
working-directory: drake_pip
4844
run: .github/ci_build_test

drake_pip/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Python Project with Drake Installed from pip
1+
# Python Project with Drake Installed from Pip
22

33
This installs Drake using [`pip`](https://pypi.org/project/pip/), the Python package manager.
44

55
## Instructions
66

7-
First, install the required packages:
7+
First, install the required Ubuntu packages (this step is not needed on Mac):
88

99
```
1010
setup/install_prereqs

drake_pip/setup/install_prereqs

Lines changed: 29 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -36,63 +36,35 @@ if [[ "${EUID}" -ne 0 ]]; then
3636
maybe_sudo=sudo
3737
fi
3838

39-
case "$OSTYPE" in
40-
darwin*)
41-
# Mac specific installations
42-
if [[ "${EUID}" -eq 0 ]]; then
43-
echo 'This script must NOT be run as root' >&2
44-
exit 1
45-
fi
39+
# Ubuntu-specific installations
40+
${maybe_sudo} apt-get update
41+
${maybe_sudo} apt-get install --no-install-recommends lsb-release
4642

47-
if [[ ! -d /opt/drake ]]; then
48-
${maybe_sudo} mkdir -p /opt/drake
49-
${maybe_sudo} chmod g+rwx /opt/drake
50-
${maybe_sudo} chown "${USER}" /opt/drake
51-
${maybe_sudo} chgrp admin /opt/drake
52-
fi
53-
54-
# Install Drake dependencies.
55-
curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-mac-arm64.tar.gz
56-
trap 'rm -f drake.tar.gz' EXIT
57-
tar -xf drake.tar.gz -C /opt
58-
;;
59-
60-
linux*)
61-
# Ubuntu specific installations
62-
if [[ "${EUID:-}" -ne 0 ]]; then
63-
echo 'This script must be run as root' >&2
64-
exit 2
65-
fi
66-
67-
${maybe_sudo} apt-get update
68-
${maybe_sudo} apt-get install --no-install-recommends lsb-release
69-
70-
if [[ "$(lsb_release -sc)" != 'jammy' ]]; then
71-
echo 'This script requires Ubuntu 22.04 (Jammy)' >&2
72-
exit 3
73-
fi
74-
75-
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
76-
ca-certificates
77-
wget
43+
# Jammy and Noble have slightly different package versions needed
44+
# (libglib2.0-0 vs. libglib2.0-0t64)
45+
if [[ "$(lsb_release -sc)" == 'jammy' ]]; then
46+
${maybe_sudo} apt-get update
47+
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
48+
python3-all-dev
49+
libegl1
50+
libx11-6
51+
libsm6
52+
libglib2.0-0
53+
pipx
7854
EOF
79-
)
80-
81-
wget -O drake.tar.gz \
82-
https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz
83-
trap 'rm -f drake.tar.gz' EXIT
84-
tar -xf drake.tar.gz -C /opt
85-
86-
${maybe_sudo} apt-get update
87-
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
88-
python3-all-dev
89-
python3.10-venv
55+
)
56+
elif [[ "$(lsb_release -sc)" == 'noble' ]]; then
57+
${maybe_sudo} apt-get update
58+
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
59+
python3-all-dev
60+
libegl1
61+
libx11-6
62+
libsm6
63+
libglib2.0-0t64
64+
pipx
9065
EOF
91-
)
92-
;;
93-
esac
94-
95-
# Show version for debugging; use echo for newline / readability.
96-
echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n"
97-
98-
/opt/drake/share/drake/setup/install_prereqs
66+
)
67+
else
68+
echo 'This script requires Ubuntu 22.04 (Jammy) or 24.04 (Noble)' >&2
69+
exit 3
70+
fi

drake_poetry/.github/macos_setup

Lines changed: 0 additions & 9 deletions
This file was deleted.

drake_poetry/.github/ubuntu_setup

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90-get-assume-yes
88

99
export DEBIAN_FRONTEND='noninteractive'
1010

11-
setup/install_prereqs
12-
13-
pipx install poetry
14-
pipx ensurepath
11+
setup/install_prereqs

drake_poetry/.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
python-version: '3.12'
4242
- name: poetry setup
4343
working-directory: drake_poetry
44-
run: .github/macos_setup
44+
run: setup/install_prereqs
4545
shell: zsh -efuo pipefail {0}
4646
- name: poetry build and test
4747
working-directory: drake_poetry

drake_poetry/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Python Project with Drake Installed from pip
1+
# Python Project with Drake Installed from Poetry
22

33
This installs Drake using [`poetry`](https://python-poetry.org/), the Python package manager.
44

55
For an introduction to `poetry`, see [Basic usage](https://python-poetry.org/docs/basic-usage/).
66

77
## Instructions
88

9-
First, install the required packages:
9+
First, install the required packages. This includes an installation of Poetry using `pipx`;
10+
see the [Installation Instructions](https://python-poetry.org/docs/#installation) for
11+
more information.
1012

1113
```
1214
setup/install_prereqs
1315
```
1416

15-
Additionally, install `poetry` following the [Installation Instructions](https://python-poetry.org/docs/#installation).
16-
1717
Call `poetry init` to create project in the current directory, including the following arguments:
1818

1919
* `--python [version]` to introduce a requirement on the version(s)

drake_poetry/setup/install_prereqs

Lines changed: 31 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -38,64 +38,46 @@ fi
3838

3939
case "$OSTYPE" in
4040
darwin*)
41-
# Mac specific installations
42-
if [[ "${EUID}" -eq 0 ]]; then
43-
echo 'This script must NOT be run as root' >&2
44-
exit 1
45-
fi
46-
47-
if [[ ! -d /opt/drake ]]; then
48-
${maybe_sudo} mkdir -p /opt/drake
49-
${maybe_sudo} chmod g+rwx /opt/drake
50-
${maybe_sudo} chown "${USER}" /opt/drake
51-
${maybe_sudo} chgrp admin /opt/drake
52-
fi
53-
54-
# Install Drake dependencies.
55-
curl -o drake.tar.gz https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-mac-arm64.tar.gz
56-
trap 'rm -f drake.tar.gz' EXIT
57-
tar -xf drake.tar.gz -C /opt
58-
41+
# Mac-specific installations
5942
brew install pipx
60-
6143
;;
6244

6345
linux*)
64-
# Ubuntu specific installations
65-
if [[ "${EUID:-}" -ne 0 ]]; then
66-
echo 'This script must be run as root' >&2
67-
exit 2
68-
fi
69-
46+
# Ubuntu-specific installations
7047
${maybe_sudo} apt-get update
7148
${maybe_sudo} apt-get install --no-install-recommends lsb-release
7249

73-
if [[ "$(lsb_release -sc)" != 'jammy' ]]; then
74-
echo 'This script requires Ubuntu 22.04 (Jammy)' >&2
75-
exit 3
76-
fi
77-
78-
apt-get install --no-install-recommends $(cat <<EOF
79-
ca-certificates
80-
wget
50+
# Jammy and Noble have slightly different package versions needed
51+
# (libglib2.0-0 vs. libglib2.0-0t64)
52+
if [[ "$(lsb_release -sc)" == 'jammy' ]]; then
53+
${maybe_sudo} apt-get update
54+
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
55+
python3-all-dev
56+
libegl1
57+
libx11-6
58+
libsm6
59+
libglib2.0-0
60+
pipx
8161
EOF
82-
)
83-
84-
wget -O drake.tar.gz \
85-
https://drake-packages.csail.mit.edu/drake/nightly/drake-latest-jammy.tar.gz
86-
trap 'rm -f drake.tar.gz' EXIT
87-
tar -xf drake.tar.gz -C /opt
88-
89-
${maybe_sudo} apt-get update
90-
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
91-
python3-all-dev
92-
pipx
62+
)
63+
elif [[ "$(lsb_release -sc)" == 'noble' ]]; then
64+
${maybe_sudo} apt-get update
65+
${maybe_sudo} apt-get install --no-install-recommends $(cat <<EOF
66+
python3-all-dev
67+
libegl1
68+
libx11-6
69+
libsm6
70+
libglib2.0-0t64
71+
pipx
9372
EOF
94-
)
73+
)
74+
else
75+
echo 'This script requires Ubuntu 22.04 (Jammy) or 24.04 (Noble)' >&2
76+
exit 3
77+
fi
9578
;;
9679
esac
9780

98-
# Show version for debugging; use echo for newline / readability.
99-
echo -e "\ndrake VERSION.TXT: $(cat /opt/drake/share/doc/drake/VERSION.TXT)\n"
100-
101-
/opt/drake/share/drake/setup/install_prereqs
81+
# Install poetry and put it on PATH
82+
pipx install poetry
83+
pipx ensurepath

0 commit comments

Comments
 (0)