Skip to content

Commit

Permalink
Update required python version (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanhphan1147 authored Apr 5, 2024
1 parent 330c89f commit 137b755
Show file tree
Hide file tree
Showing 8 changed files with 1,928 additions and 1,388 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
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
with:
pre-run-script: .github/test-pre-script.sh
self-hosted-runner: true
self-hosted-runner-label: "edge"
self-hosted-runner-label: "jammy"
provider: lxd
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
with:
pre-run-script: .github/test-pre-script.sh
self-hosted-runner: true
self-hosted-runner-label: "edge"
self-hosted-runner-label: "jammy"
4 changes: 3 additions & 1 deletion install-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ if [ "$EUID" -ne 0 ]
fi

apt-get update
apt-get install -y pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl libpython3-dev gcc libpq-dev
apt-get install -y pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl libpython3-dev gcc libpq-dev \
libxslt1-dev libffi-dev libpcre3-dev libyaml-dev build-essential libbz2-dev libreadline-dev libsqlite3-dev \
libjpeg-turbo8-dev zlib1g-dev liblzma-dev
3,266 changes: 1,892 additions & 1,374 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ branch = true
# Formatting tools configuration
[tool.black]
line-length = 99
target-version = ["py38"]
target-version = ["py312"]

[tool.coverage.report]
fail_under = 95
Expand Down Expand Up @@ -62,19 +62,19 @@ disable = "wrong-import-order"

[tool.poetry]
name = "flask-multipass-saml-groups"
version = "0.3.0"
version = "1.0.0"
description = "This package provides an identity provider for Flask-Multipass, which allows you to use SAML groups. It is designed to be used as a plugin for Indico."
authors = ["canonical-is-devops <[email protected]>"]
license = "Apache-2.0 license"
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.10, <3.12"
flask-multipass = {extras = ["saml"], version = "0.4.9"}
python = "~=3.12.2"
flask-multipass = {extras = ["saml"], version = "0.5.4"}
# The package version here can force an upgrade of indico when the plugin is used
# thus we must only specify compatibility rather than pinning the exact version
indico = ">=3.2.8, <4"
flask_sqlalchemy = "3.0.3"
indico = ">=3.3.1, <4"
flask_sqlalchemy = "3.0.5"

[build-system]
requires = ["poetry-core"]
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ author_email = [email protected]
[options]
packages = find:
include_package_data = true
python_requires = ~=3.8
python_requires = ~=3.12.2
install_requires =
flask-multipass[saml]>=0.4.8
flask-multipass[saml]>=0.5.4

[options.package_data]
flask_multipass_saml_groups = migrations/*.py
Expand Down
13 changes: 11 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ all_path = {[vars]src_path} {[vars]tst_path}

[testenv]
setenv =
# patched path for github runners so that tox can find python3.12
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 @@ -58,8 +62,11 @@ commands =
--skip {toxinidir}/build --skip {toxinidir}/venv \
--skip {toxinidir}/.mypy_cache \
--skip {toxinidir}/poetry.lock
# pflake8 wrapper supports config from pyproject.toml
pflake8 {[vars]all_path} --ignore=W503
# pflake8 wrapper supports config from pyproject.toml.
# There's a known compatibility issue with pflake8 and python3.12.
# However, flake8 output is checked in operator-workflow.
# As a result we use this as a temporary workaround!
flake8 --version
isort --check-only --diff {[vars]all_path}
black --check --diff {[vars]all_path}
mypy {[vars]all_path}
Expand All @@ -73,6 +80,7 @@ deps =
coverage[toml]
poetry
pytest
setuptools
commands_pre =
poetry install --no-root
commands =
Expand Down Expand Up @@ -117,6 +125,7 @@ deps =
pytest-operator
# Pin juju version to avoid issues with version 3.3.1.0
juju >=3.0,<=3.3.0
setuptools
commands_pre =
poetry install --no-root
commands =
Expand Down

0 comments on commit 137b755

Please sign in to comment.