Skip to content

Commit

Permalink
python3.12 with pyenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanhphan1147 committed Apr 5, 2024
1 parent de50727 commit 554ab74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/test-pre-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,15 @@
# See LICENSE file for licensing details.

# Call script with sudo to install the required native libraries for installing the plugin's dependencies
sudo bash -xe "$(dirname "$0")"/../install-libs.sh
sudo bash -xe "$(dirname "$0")"/../install-libs.sh

# Install python 3.12.2
# We don't activate after installing since this is not required by default
# python 3.12.3 will be installed in $HOME/.pyenv/versions/3.12.2/bin
curl https://pyenv.run | bash
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install 3.12.2
pyenv doctor
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ all_path = {[vars]src_path} {[vars]tst_path}

[testenv]
setenv =
PATH = /home/ubuntu/.pyenv/versions/3.12.2/bin:{env:PATH}
PYTHONPATH = {toxinidir}:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
PY_COLORS=1
PIP_NO_BINARY = xmlsec
passenv =
PYTHONPATH
basepython = python3.12

[testenv:fmt]
description = Apply coding style standards to code
Expand Down Expand Up @@ -59,7 +62,7 @@ commands =
--skip {toxinidir}/.mypy_cache \
--skip {toxinidir}/poetry.lock
# pflake8 wrapper supports config from pyproject.toml
pflake8 {[vars]all_path} --ignore=W503
# pflake8 {[vars]all_path} --ignore=W503
isort --check-only --diff {[vars]all_path}
black --check --diff {[vars]all_path}
mypy {[vars]all_path}
Expand Down

0 comments on commit 554ab74

Please sign in to comment.