diff --git a/.github/workflows/gating.yaml b/.github/workflows/gating.yaml index fc65353..2d7fbcb 100644 --- a/.github/workflows/gating.yaml +++ b/.github/workflows/gating.yaml @@ -23,18 +23,24 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install system dependencies + uses: nick-invision/retry@v2 + with: + timeout_minutes: 10 + retry_wait_seconds: 30 + max_attempts: 3 + command: >- + sudo apt-get update + && sudo apt-get install + libkrb5-dev + libldap2-dev + libsasl2-dev + - name: Install dependencies - run: | - sudo apt-get -y update - sudo apt-get -y install libkrb5-dev libldap2-dev libsasl2-dev - python -m pip install --upgrade pip - pip install tox + run: python -m pip install tox - name: Test with tox - run: tox -e py - - - name: Test with mypy - run: tox -e mypy + run: python -m tox -e py3 - name: Run coveralls-python env: @@ -99,7 +105,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install poetry tox + pip install poetry - name: Update the Application Version run: poetry version "$(./get-version.sh)" diff --git a/Dockerfile b/Dockerfile index 1398427..28f3e2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN set -exo pipefail \ # install runtime dependencies && yum install -y \ --installroot=/mnt/rootfs \ - --releasever=39 \ + --releasever=/ \ --setopt install_weak_deps=false \ --nodocs \ --disablerepo=* \ diff --git a/poetry.lock b/poetry.lock index 1732118..efd741c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -356,22 +356,6 @@ typing-extensions = ">=4.8.0" [package.extras] all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] -[[package]] -name = "flake8" -version = "7.0.0" -description = "the modular source code checker: pep8 pyflakes and co" -optional = true -python-versions = ">=3.8.1" -files = [ - {file = "flake8-7.0.0-py2.py3-none-any.whl", hash = "sha256:a6dfbb75e03252917f2473ea9653f7cd799c3064e54d4c8140044c5c065f53c3"}, - {file = "flake8-7.0.0.tar.gz", hash = "sha256:33f96621059e65eec474169085dc92bf26e7b2d47366b70be2f67ab80dc25132"}, -] - -[package.dependencies] -mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.11.0,<2.12.0" -pyflakes = ">=3.2.0,<3.3.0" - [[package]] name = "googleapis-common-protos" version = "1.63.0" @@ -679,17 +663,6 @@ requests = "*" requests-gssapi = "*" six = "*" -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = true -python-versions = ">=3.6" -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - [[package]] name = "opentelemetry-api" version = "1.22.0" @@ -1051,17 +1024,6 @@ files = [ [package.dependencies] pyasn1 = ">=0.4.6,<0.7.0" -[[package]] -name = "pycodestyle" -version = "2.11.1" -description = "Python style guide checker" -optional = true -python-versions = ">=3.8" -files = [ - {file = "pycodestyle-2.11.1-py2.py3-none-any.whl", hash = "sha256:44fe31000b2d866f2e41841b18528a505fbd7fef9017b04eff4e2648a0fadc67"}, - {file = "pycodestyle-2.11.1.tar.gz", hash = "sha256:41ba0e7afc9752dfb53ced5489e89f8186be00e599e712660695b7a75ff2663f"}, -] - [[package]] name = "pydantic" version = "2.6.4" @@ -1172,17 +1134,6 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" -[[package]] -name = "pyflakes" -version = "3.2.0" -description = "passive checker of Python programs" -optional = true -python-versions = ">=3.8" -files = [ - {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, - {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, -] - [[package]] name = "pytest" version = "8.1.1" @@ -1878,9 +1829,9 @@ docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.link testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [extras] -test = ["flake8", "httpx", "pytest", "pytest-cov"] +test = ["factory-boy", "httpx", "pytest", "pytest-cov"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.13" -content-hash = "a2cc2f664c7fa0df289577b33f4decedffec49a1382b2c5d99c7a5942efe1caf" +content-hash = "0a0a5cf0ba7de32381ef8f180b43640a6a9054669d55e9377877133814a1d964" diff --git a/pyproject.toml b/pyproject.toml index b4ef16f..c003f17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ fastapi = "^0.110.0" gunicorn = "^21.2.0" python-dateutil = "^2.8.2" -flake8 = {version = "^7.0.0", optional = true} factory-boy = {version = "^3.3.0", optional = true} pytest = {version = "^8.0.0", optional = true} pytest-cov = {version = "^5.0.0", optional = true} @@ -46,7 +45,7 @@ opentelemetry-instrumentation-sqlalchemy = "^0.43b0" [tool.poetry.extras] test = [ - "flake8", + "factory-boy", "pytest", "pytest-cov", # required by fastapi.testclient diff --git a/tox.ini b/tox.ini index 6d3fe60..366e016 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,18 @@ [tox] envlist = py3,mypy -isolated_build = True +requires = + poetry [testenv] +allowlist_externals = poetry +skip_install = true +no_package = true + +[testenv:py3] # Set RPM_PY_VERBOSE to "true" to debug koji package installation failures passenv = RPM_PY_VERBOSE -extras = - test +commands_pre = + poetry install --only=main --extras=test commands = pytest \ --cov-reset \ @@ -17,7 +23,6 @@ commands = {posargs} [testenv:mypy] -skip_install = true deps = mypy commands =