From 53f90278d788a0e7c8cde8fe980b80ea08ebbc08 Mon Sep 17 00:00:00 2001 From: jamshale Date: Tue, 25 Jun 2024 22:12:38 +0000 Subject: [PATCH] Upgrade project to python version 3.12 Signed-off-by: jamshale --- .devcontainer/Dockerfile | 4 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/blackformat.yml | 2 +- .github/workflows/nigthly.yml | 2 +- .github/workflows/pr-tests.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/sonar-merge-main.yml | 2 +- .readthedocs.yaml | 2 +- demo/runners/support/agent.py | 2 +- docker/Dockerfile | 2 +- poetry.lock | 76 +------------------------- pyproject.toml | 2 +- sonar-project.properties | 2 +- 13 files changed, 16 insertions(+), 86 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 12b6218ab4..7c00242956 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/python-3/.devcontainer/base.Dockerfile -ARG VARIANT="3.9" -FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} +ARG VARIANT="3.12" +FROM mcr.microsoft.com/devcontainers/python:${VARIANT} ARG POETRY_VERSION="1.4" ENV POETRY_HOME="/opt/poetry" \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c65f9db426..fafa3e847c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,7 @@ "dockerfile": "Dockerfile", "context": "..", "args": { - "VARIANT": "3.9-bullseye", + "VARIANT": "3.12-bullseye", "POETRY_VERSION": "1.7.1" } }, diff --git a/.github/workflows/blackformat.yml b/.github/workflows/blackformat.yml index 93d54834ae..2257bae7b3 100644 --- a/.github/workflows/blackformat.yml +++ b/.github/workflows/blackformat.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.12" - name: Black Code Formatter Check # The version of black should be adjusted at the same time dev # dependencies are updated. diff --git a/.github/workflows/nigthly.yml b/.github/workflows/nigthly.yml index 7427d28d21..ef28b719e1 100644 --- a/.github/workflows/nigthly.yml +++ b/.github/workflows/nigthly.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.9", "3.10"] + python-version: ["3.12"] if: github.repository == 'hyperledger/aries-cloudagent-python' || github.event_name == 'workflow_dispatch' steps: - name: checkout diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 6813b88dc0..0403ca1548 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -16,6 +16,6 @@ jobs: - name: Tests uses: ./.github/actions/run-unit-tests with: - python-version: "3.9" + python-version: "3.12" os: "ubuntu-latest" is_pr: "true" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8195dc1b7c..9a0b9a88a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -42,7 +42,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9'] + python-version: ['3.12'] name: Publish ACA-Py Image runs-on: ubuntu-latest diff --git a/.github/workflows/sonar-merge-main.yml b/.github/workflows/sonar-merge-main.yml index 0962261203..e63f649f7e 100644 --- a/.github/workflows/sonar-merge-main.yml +++ b/.github/workflows/sonar-merge-main.yml @@ -15,7 +15,7 @@ jobs: - name: Tests uses: ./.github/actions/run-unit-tests with: - python-version: "3.9" + python-version: "3.12" os: "ubuntu-latest" is_pr: "false" - name: Adjust Test Coverage Source diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1463fd36ef..4865ff8187 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,7 +3,7 @@ version: 2 build: os: "ubuntu-20.04" tools: - python: "3.9" + python: "3.12" sphinx: builder: dirhtml diff --git a/demo/runners/support/agent.py b/demo/runners/support/agent.py index 606d87d0f7..d01b26b418 100644 --- a/demo/runners/support/agent.py +++ b/demo/runners/support/agent.py @@ -941,7 +941,7 @@ async def start_process(self, python_path: str = None, wait: bool = True): future = loop.run_in_executor( self.thread_pool_executor, self._process, agent_args, my_env, loop ) - self.proc = await asyncio.wait_for(future, 20, loop=loop) + self.proc = await asyncio.wait_for(future, 20) if wait: await asyncio.sleep(1.0) await self.detect_process() diff --git a/docker/Dockerfile b/docker/Dockerfile index aa75487b65..5665f4989b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG python_version=3.9.18 +ARG python_version=3.12 FROM python:${python_version}-slim-bullseye AS build WORKDIR /src diff --git a/poetry.lock b/poetry.lock index b64131a720..0e476df9a2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -87,7 +87,6 @@ files = [ [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" @@ -308,8 +307,6 @@ mypy-extensions = ">=0.4.3" packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -625,9 +622,6 @@ files = [ {file = "coverage-7.5.3.tar.gz", hash = "sha256:04aefca5190d1dc7a53a4c1a5a7f8568811306d7a8ee231c42fb69215571944f"}, ] -[package.dependencies] -tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} - [package.extras] toml = ["tomli"] @@ -942,20 +936,6 @@ dev = ["build (>=0.9.0)", "bumpversion (>=0.5.3)", "eth-hash[pycryptodome]", "hy docs = ["sphinx (>=6.0.0)", "sphinx-autobuild (>=2021.3.14)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] test = ["hypothesis (>=4.43.0)", "mypy (==1.5.1)", "pytest (>=7.0.0)", "pytest-xdist (>=2.4.0)"] -[[package]] -name = "exceptiongroup" -version = "1.2.1" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "filelock" version = "3.14.0" @@ -1136,25 +1116,6 @@ files = [ {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] -[[package]] -name = "importlib-metadata" -version = "7.1.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "importlib_metadata-7.1.0-py3-none-any.whl", hash = "sha256:30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570"}, - {file = "importlib_metadata-7.1.0.tar.gz", hash = "sha256:b78938b926ee8d5f020fc4772d487045805a55ddbad2ecf21c6d60938dc7fcd2"}, -] - -[package.dependencies] -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-perf (>=0.9.2)", "pytest-ruff (>=0.2.1)"] - [[package]] name = "indy-credx" version = "1.1.1" @@ -1418,9 +1379,6 @@ files = [ {file = "Markdown-3.6.tar.gz", hash = "sha256:ed4f41f6daecbeeb96e576ce414c41d2d876daa9a16cb35fa8ed8c2ddfad0224"}, ] -[package.dependencies] -importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} - [package.extras] docs = ["mdx-gh-links (>=0.2)", "mkdocs (>=1.5)", "mkdocs-gen-files", "mkdocs-literate-nav", "mkdocs-nature (>=0.6)", "mkdocs-section-index", "mkdocstrings[python]"] testing = ["coverage", "pyyaml"] @@ -2141,11 +2099,9 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=1.5,<2.0" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] @@ -2531,17 +2487,6 @@ sphinxcontrib-serializinghtml = "*" lint = ["flake8"] test = ["Sphinx", "pytest", "sqlalchemy", "whoosh"] -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - [[package]] name = "toolz" version = "0.12.1" @@ -2852,26 +2797,11 @@ files = [ idna = ">=2.0" multidict = ">=4.0" -[[package]] -name = "zipp" -version = "3.19.2" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.8" -files = [ - {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, - {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, -] - -[package.extras] -doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] - [extras] askar = ["anoncreds", "aries-askar", "indy-credx", "indy-vdr"] bbs = ["ursa-bbs-signatures"] [metadata] lock-version = "2.0" -python-versions = "^3.9" -content-hash = "1907c1604b9ce9c2a7e3147d29ef783df9f82cc3e60f835344e06c12c20f824e" +python-versions = "^3.12" +content-hash = "e96905100ba82770f800410cb48a9cc47c93c814efeffea4435c5bdeb98f4aa5" diff --git a/pyproject.toml b/pyproject.toml index 96278614d7..b92ef2eaea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ repository = "https://github.com/hyperledger/aries-cloudagent-python" [tool.poetry.dependencies] -python = "^3.9" +python = "^3.12" aiohttp="~3.9.4" aiohttp-apispec-acapy="~3.0.2" aiohttp-cors="~0.7.0" diff --git a/sonar-project.properties b/sonar-project.properties index 03ad4b3b74..6c87546ee1 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,4 +2,4 @@ sonar.projectKey=hyperledger_aries-cloudagent-python sonar.organization=hyperledger sonar.projectName=aries-cloudagent-python -sonar.python.version=3.9 \ No newline at end of file +sonar.python.version=3.12 \ No newline at end of file