Skip to content

Commit

Permalink
doc: python env setup fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed May 11, 2024
1 parent a63ed86 commit b4725d9
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,36 +104,38 @@ sudo nala install --no-autoremove -y gcc-arm-none-eabi cmake ninja-build srecord
printf "\n"

python --version
pip install mpremote
pip install --upgrade mpremote

if [[ ! -d .venv ]]; then
latest_python_version="$(pyenv versions --bare | grep '^3[.]' | sort -V | tail -n 1)"
pyenv local "${latest_python_version}"
pyenv local
printf "\n"

latest_mp_version="$(pyenv versions --bare | grep micropython | sort -V)"
if ! pyenv versions | grep -q "${latest_mp_version}"; then
pyenv install "${latest_mp_version}"
pyenv versions
fi
printf "\n"

# can't use pdm with micropython
# pyenv local "${latest_mp_version}"
# pyenv local
# printf "\n"

latest_python_version="$(pyenv versions | sed -r -e 's/\s//g' | grep '^3[.]' | tail -n 1)"
pyenv local "${latest_python_version}"
pyenv local
printf "\n"

latest_mp_version="$(pyenv versions | grep micropython | sed -r -e 's/\s//g')"
if ! pyenv versions | grep -q "${latest_mp_version}"; then
pyenv install "${latest_mp_version}"
pyenv versions
fi
printf "\n"

# can't use pdm with micropython
# pyenv local "${latest_mp_version}"
# pyenv local
# printf "\n"
printf "\n"

pyenv versions
printf "\n"

# instead of pip use
# micropython -m mip install pkgname
# instead of pip use
# micropython -m mip install pkgname

pdm venv create -w virtualenv --with-pip python
printf "\n"
pdm venv create -w virtualenv --with-pip python
printf "\n"

pdm use python
printf "\n"
pdm use python
printf "\n"
fi

# create lock file
pdm lock
Expand Down

0 comments on commit b4725d9

Please sign in to comment.