-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add Linux prep instructions to developer guide #575
Add Linux prep instructions to developer guide #575
Conversation
29cfb30
to
fdff368
Compare
docs/developer_guide.md
Outdated
(these instructions are tested on Ubuntu 24.04 which has clang-18 and python3.12 by default) | ||
|
||
``` | ||
sudo apt update && sudo apt install -y python-is-python3 python3.12-venv python3-dev clang lld |
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.
Might want to recommend https://github.com/pyenv/pyenv over python-is-python3 python3.12-venv python3-dev
I regularly switch between 3.10, 3.11, 3.12, 3.13, and 3.13t when testing packages.
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.
pyenv sounds awesome & would probably make it a lot annoying to manage this. However, I have zero experience with pyenv and really am not the best qualified person to write these instructions.
What do you think about just getting the apt install command in to fix the immediate frustrations I was dealing with, then revamping these instructions for pyenv in a later PR?
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.
That's fine, but I wouldn't over-index on Ubuntu 24.04 and Python 3.12.
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.
Personally, I like just linking to pyenv and saying it's a good tool to use for managing multiple python environments. Probably too verbose for our docs, but if you wanted to check it out, here are some setup instructions:
Pre-Reqs for ubuntu from their wiki
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
Installing pyenv from instructions here
curl https://pyenv.run | bash
Add to .bashrc
It's also outputted by installer after running installation:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
Run source ~/.bashrc
source ~/.bashrc
Check installation
pyenv --version
Install whichever version you need (i.e. for 3.12)
pyenv install 3.12
Set as local version
In your workspace:
pyenv local 3.12
Check python version
python --version
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.
yup i saw those. Made this based on that:
Turns out pyenv can be just an extra step you do to replace python3-venv
I think we should just do venv for simplicity's sake but i'll add a lil click-expand section on using pyenv
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.
+1 that seems reasonable to focus on venv and just point to pyenv as an option. This is the same idea we did in other places.
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.
Turns out pyenv can be just an extra step you do to replace python3-venv
I think we should just do venv for simplicity's sake but i'll add a lil click-expand section on using pyenv
pyenv and venv are different. Prior discussion in this repo: #524 (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.
Sorry. mybad. not replace, but supplement.
Repalces python-is-python3, and docs adjusted accordingly.
fdff368
to
478020e
Compare
docs/developer_guide.md
Outdated
(these instructions are tested on Ubuntu 24.04 which has clang-18 and python3.12 by default) | ||
|
||
``` | ||
sudo apt update && sudo apt install -y python-is-python3 python3.12-venv python3-dev clang lld |
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.
+1 that seems reasonable to focus on venv and just point to pyenv as an option. This is the same idea we did in other places.
Edits incorporated & pls re-review. |
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.
LGTM but you want to wait for Scott's approval
<summary> Or, alternatively, use `pyenv` to manage a separate python installation for more control over its version: </summary> | ||
|
||
|
||
First, install pyenv and its dependencies. | ||
|
||
```bash | ||
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \ | ||
libbz2-dev libreadline-dev libsqlite3-dev curl git \ | ||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | ||
curl https://pyenv.run | bash | ||
``` | ||
|
||
Then, make pyenv available by adding the below to your `~/.bashrc`: | ||
|
||
```bash | ||
export PYENV_ROOT="$HOME/.pyenv" | ||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init -)" | ||
``` | ||
|
||
Finally, install a pyenv-managed version of python | ||
|
||
```bash | ||
pyenv install 3.12 # or whichever python version you'd like | ||
pyenv local 3.12 | ||
``` |
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.
At least link to the upstream documentation here. I wouldn't even include the inlined copy of their docs, but that's up to you. Each line of documentation we add here is an extra line of documentation to keep from going stale. Direct people to upstream, which will actually be maintained.
``` | ||
python-is-python3 python3-venv python3-dev | ||
``` |
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.
Prefix these with sudo apt install
Also nit: set the syntax for code blocks (```bash)
ack merged before i saw Chris's comment. Let me incorporate the comments in another PR, |
[skip ci]
There are some apt packages needed before it would work.