From 988099d0363edcce33074e7c2c032035177f7b7f Mon Sep 17 00:00:00 2001 From: Gguidini Date: Wed, 6 Mar 2024 14:14:35 +0100 Subject: [PATCH] Downgrade image to Python 3.11 Also changing `postgres://` to `postgresql://` because support for the former was dropped in SQLAlchemy 1.4 --- .github/workflows/ci.yml | 39 ------ Makefile | 11 -- database/engine.py | 4 +- docker/Dockerfile.requirements | 2 +- docker/test_codecov_config.yml | 4 +- requirements.in | 2 +- requirements.txt | 214 +++++++++++++++++---------------- 7 files changed, 114 insertions(+), 162 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a80000e53..d7b03b0a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,42 +82,3 @@ jobs: with: push_rolling: true repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-worker' }} - - mutation: - name: Run Mutations - needs: [build] - runs-on: ubuntu-latest - env: - AR_REPO: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-worker' }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Cache App - id: cache-app - uses: actions/cache@v3 - env: - cache-name: cache-app - with: - path: | - app.tar - key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }} - - name: Load built image - run: | - docker load --input app.tar - - name: Install docker compose - run: | - sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - - name: Bring test env up - run: | - make test_env.up - - name: Prepare for tests - run: | - make test_env.prepare - - name: Run mutations - run: | - make test_env.run_mutation - - diff --git a/Makefile b/Makefile index fdc99d4e2..757e4bb44 100644 --- a/Makefile +++ b/Makefile @@ -248,17 +248,6 @@ test_env.container_label_analysis: test_env.container_ats: codecovcli -u ${CODECOV_URL} --codecov-yml-path=codecov_cli.yml do-upload --plugin pycoverage --plugin compress-pycoverage --flag onlysomelabels --fail-on-error -test_env.run_mutation: - docker-compose exec worker make test_env.container_mutation - -test_env.container_mutation: - apt-get install -y git - git diff origin/main ${full_sha} > data.patch - pip install mutmut[patch] - mutmut run --use-patch-file data.patch || true - mkdir /tmp/artifacts; - mutmut junitxml > /tmp/artifacts/mut.xml - test_env: make test_env.up make test_env.prepare diff --git a/database/engine.py b/database/engine.py index 515596db8..8c8a229be 100644 --- a/database/engine.py +++ b/database/engine.py @@ -77,12 +77,12 @@ def get_bind(self, mapper=None, clause=None): database_url=get_config( "services", "database_url", - default="postgres://postgres:@postgres:5432/postgres", + default="postgresql://postgres:@postgres:5432/postgres", ), timeseries_database_url=get_config( "services", "timeseries_database_url", - default="postgres://postgres:@timescale:5432/postgres", + default="postgresql://postgres:@timescale:5432/postgres", ), ) diff --git a/docker/Dockerfile.requirements b/docker/Dockerfile.requirements index 677176a73..beec13b02 100644 --- a/docker/Dockerfile.requirements +++ b/docker/Dockerfile.requirements @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -ARG PYTHON_IMAGE=python:3.12.2-slim-bookworm +ARG PYTHON_IMAGE=python:3.11-slim-bookworm # BUILD STAGE FROM $PYTHON_IMAGE as build diff --git a/docker/test_codecov_config.yml b/docker/test_codecov_config.yml index 4f729f3fb..b567f5fb0 100644 --- a/docker/test_codecov_config.yml +++ b/docker/test_codecov_config.yml @@ -5,8 +5,8 @@ setup: encryption_secret: "zp^P9*i8aR3" services: - database_url: postgres://postgres:password@postgres:5432/postgres - timeseries_database_url: postgres://postgres:password@timescale:5432/postgres + database_url: postgresql://postgres:password@postgres:5432/postgres + timeseries_database_url: postgresql://postgres:password@timescale:5432/postgres redis_url: redis://redis:6379 minio: hash_key: testixik8qdauiab1yiffydimvi72ekq # never change this diff --git a/requirements.in b/requirements.in index 510b4b8e0..e67103e44 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,4 @@ -https://github.com/codecov/shared/archive/5c6de0f898bfa32ef64a23b3519e44fa99028845.tar.gz#egg=shared +https://github.com/codecov/shared/archive/51afadfc8cc677f216c44a87d2609c84c564da01.tar.gz#egg=shared https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem https://github.com/codecov/test-results-parser/archive/5515e960d5d38881036e9127f86320efca649f13.tar.gz#egg=test-results-parser boto3 diff --git a/requirements.txt b/requirements.txt index ff62d1361..8f93d3016 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.10 +# This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile requirements.in +# pip-compile # amqp==5.2.0 # via kombu @@ -12,27 +12,33 @@ analytics-python==1.3.0b1 # shared annotated-types==0.6.0 # via pydantic -anyio==3.6.1 +anyio==4.3.0 # via - # httpcore + # httpx # openai +argon2-cffi==23.1.0 + # via minio +argon2-cffi-bindings==21.2.0 + # via argon2-cffi asgiref==3.7.2 # via django -attrs==20.3.0 +async-timeout==4.0.3 + # via redis +attrs==23.2.0 # via pytest backoff==1.6.0 # via analytics-python billiard==4.2.0 # via celery -boto3==1.17.26 +boto3==1.34.54 # via # -r requirements.in # shared -botocore==1.20.26 +botocore==1.34.54 # via # boto3 # s3transfer -cachetools==4.2.1 +cachetools==5.3.3 # via # google-auth # shared @@ -40,9 +46,9 @@ celery==5.3.6 # via # -r requirements.in # pytest-celery -cerberus==1.3.4 +cerberus==1.3.5 # via shared -certifi==2023.7.22 +certifi==2024.2.2 # via # httpcore # httpx @@ -50,13 +56,13 @@ certifi==2023.7.22 # requests # sentry-sdk # shared -cffi==1.14.5 +cffi==1.16.0 # via + # argon2-cffi-bindings # cryptography - # google-crc32c cfgv==3.4.0 # via pre-commit -charset-normalizer==2.0.12 +charset-normalizer==3.3.2 # via requests click==8.1.7 # via @@ -69,7 +75,7 @@ click-didyoumean==0.3.0 # via celery click-plugins==1.1.1 # via celery -click-repl==0.2.0 +click-repl==0.3.0 # via celery codecov-ribs==0.1.18 # via @@ -79,18 +85,18 @@ codecovopentelem @ https://github.com/codecov/opentelem-python/archive/refs/tags # via -r requirements.in colour==0.1.5 # via shared -coverage==5.5 +coverage[toml]==7.4.3 # via # -r requirements.in # codecovopentelem # pytest-cov -cryptography==42.0.0 +cryptography==42.0.5 # via shared -deprecated==1.2.12 +deprecated==1.2.14 # via opentelemetry-api -distlib==0.3.7 +distlib==0.3.8 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via openai django==4.2.7 # via shared @@ -108,45 +114,48 @@ ecdsa==0.18.0 # via tlslite-ng excel-base==1.0.4 # via django-excel-response2 -factory-boy==3.2.0 +factory-boy==3.3.0 # via -r requirements.in -faker==8.8.2 +faker==23.3.0 # via factory-boy -filelock==3.12.4 +filelock==3.13.1 # via virtualenv -freezegun==1.2.2 +freezegun==1.4.0 # via pytest-freezegun -google-api-core[grpc]==2.11.1 +google-api-core[grpc]==2.17.1 # via # google-cloud-core # google-cloud-pubsub # google-cloud-storage -google-auth==2.21.0 +google-auth==2.28.1 # via # google-api-core # google-cloud-core + # google-cloud-pubsub # google-cloud-storage # shared -google-cloud-core==2.3.3 +google-cloud-core==2.4.1 # via google-cloud-storage -google-cloud-pubsub==2.18.4 +google-cloud-pubsub==2.19.7 # via # -r requirements.in # shared -google-cloud-storage==2.10.0 +google-cloud-storage==2.14.0 # via # -r requirements.in # shared -google-crc32c==1.1.2 - # via google-resumable-media -google-resumable-media==2.5.0 +google-crc32c==1.5.0 + # via + # google-cloud-storage + # google-resumable-media +google-resumable-media==2.7.0 # via google-cloud-storage -googleapis-common-protos[grpc]==1.59.1 +googleapis-common-protos[grpc]==1.62.0 # via # google-api-core # grpc-google-iam-v1 # grpcio-status -grpc-google-iam-v1==0.12.6 +grpc-google-iam-v1==0.13.0 # via google-cloud-pubsub grpcio==1.62.0 # via @@ -155,41 +164,41 @@ grpcio==1.62.0 # googleapis-common-protos # grpc-google-iam-v1 # grpcio-status -grpcio-status==1.58.0 +grpcio-status==1.62.0 # via # google-api-core # google-cloud-pubsub h11==0.14.0 # via httpcore -httpcore==0.16.3 +httpcore==1.0.4 # via httpx -httplib2==0.19.0 +httplib2==0.22.0 # via oauth2 -httpx==0.23.1 +httpx==0.27.0 # via # -r requirements.in # openai # respx # shared -identify==2.5.30 +identify==2.5.35 # via pre-commit -idna==2.10 +idna==3.6 # via # anyio + # httpx # requests - # rfc3986 # yarl ijson==3.2.3 # via shared -importlib-metadata==6.8.0 +importlib-metadata==6.11.0 # via opentelemetry-api -iniconfig==1.1.1 +iniconfig==2.0.0 # via pytest isoweek==1.3.3 # via timeconvert jinja2==3.1.3 # via -r requirements.in -jmespath==0.10.0 +jmespath==1.0.1 # via # boto3 # botocore @@ -197,58 +206,58 @@ kombu==5.3.5 # via celery lxml==5.1.0 # via -r requirements.in -markupsafe==2.1.3 +markupsafe==2.1.5 # via jinja2 -minio==7.1.13 +minio==7.2.5 # via shared -mmh3==4.0.1 +mmh3==4.1.0 # via shared -mock==4.0.3 +mock==5.1.0 # via -r requirements.in -monotonic==1.5 +monotonic==1.6 # via analytics-python -multidict==5.1.0 +multidict==6.0.5 # via yarl nodeenv==1.8.0 # via pre-commit oauth2==1.9.0.post1 # via shared -oauthlib==3.1.0 +oauthlib==3.2.2 # via shared -openai==1.2.4 +openai==1.13.3 # via -r requirements.in -opentelemetry-api==1.20.0 +opentelemetry-api==1.23.0 # via # opentelemetry-instrumentation # opentelemetry-instrumentation-celery # opentelemetry-sdk -opentelemetry-instrumentation==0.41b0 +opentelemetry-instrumentation==0.44b0 # via opentelemetry-instrumentation-celery -opentelemetry-instrumentation-celery==0.41b0 +opentelemetry-instrumentation-celery==0.44b0 # via -r requirements.in -opentelemetry-sdk==1.20.0 +opentelemetry-sdk==1.23.0 # via # -r requirements.in # codecovopentelem -opentelemetry-semantic-conventions==0.41b0 +opentelemetry-semantic-conventions==0.44b0 # via # opentelemetry-instrumentation-celery # opentelemetry-sdk -packaging==20.9 +packaging==23.2 # via pytest -platformdirs==3.11.0 +platformdirs==4.2.0 # via virtualenv -pluggy==0.13.1 +pluggy==1.4.0 # via pytest -pre-commit==3.4.0 +pre-commit==3.6.2 # via -r requirements.in -prometheus-client==0.17.1 +prometheus-client==0.20.0 # via shared -prompt-toolkit==3.0.28 +prompt-toolkit==3.0.43 # via click-repl -proto-plus==1.22.3 +proto-plus==1.23.0 # via google-cloud-pubsub -protobuf==4.24.3 +protobuf==4.25.3 # via # google-api-core # google-cloud-pubsub @@ -257,28 +266,28 @@ protobuf==4.24.3 # grpcio-status # proto-plus # shared -psycopg2==2.9.3 +psycopg2==2.9.9 # via -r requirements.in -pyasn1==0.4.8 +pyasn1==0.5.1 # via # pyasn1-modules # rsa -pyasn1-modules==0.2.8 +pyasn1-modules==0.3.0 # via google-auth -pycparser==2.20 +pycparser==2.21 # via cffi -pydantic==2.5.0 +pycryptodome==3.20.0 + # via minio +pydantic==2.6.3 # via openai -pydantic-core==2.14.1 +pydantic-core==2.16.3 # via pydantic -pyjwt==2.4.0 +pyjwt==2.8.0 # via # -r requirements.in # shared -pyparsing==2.4.7 - # via - # httplib2 - # packaging +pyparsing==3.1.1 + # via httplib2 pytest==7.2.0 # via # -r requirements.in @@ -292,17 +301,17 @@ pytest-asyncio==0.14.0 # via -r requirements.in pytest-celery==0.0.0 # via -r requirements.in -pytest-cov==2.11.1 +pytest-cov==4.1.0 # via -r requirements.in -pytest-django==4.7.0 +pytest-django==4.8.0 # via -r requirements.in pytest-freezegun==0.4.2 # via -r requirements.in -pytest-mock==1.13.0 +pytest-mock==3.12.0 # via -r requirements.in pytest-sqlalchemy==0.2.1 # via -r requirements.in -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -r requirements.in # analytics-python @@ -311,11 +320,11 @@ python-dateutil==2.8.2 # faker # freezegun # timeconvert -python-json-logger==0.1.11 +python-json-logger==2.0.7 # via -r requirements.in python-redis-lock==4.0.0 # via -r requirements.in -pytz==2022.1 +pytz==2024.1 # via # shared # timestring @@ -324,7 +333,7 @@ pyyaml==6.0.1 # -r requirements.in # pre-commit # vcrpy -redis==4.5.4 +redis==5.0.2 # via # -r requirements.in # python-redis-lock @@ -339,71 +348,65 @@ requests==2.31.0 # stripe respx==0.20.2 # via -r requirements.in -rfc3986[idna2008]==1.4.0 - # via httpx -rsa==4.7.2 +rsa==4.9 # via google-auth -s3transfer==0.3.4 +s3transfer==0.10.0 # via boto3 screen==1.0.1 # via excel-base -sentry-sdk==1.40.0 +sentry-sdk==1.40.6 # via -r requirements.in -shared @ https://github.com/codecov/shared/archive/5c6de0f898bfa32ef64a23b3519e44fa99028845.tar.gz +shared @ https://github.com/codecov/shared/archive/51afadfc8cc677f216c44a87d2609c84c564da01.tar.gz # via -r requirements.in -six==1.15.0 +six==1.16.0 # via # analytics-python - # click-repl # ecdsa - # google-auth # python-dateutil - # sqlalchemy-utils -sniffio==1.2.0 +sniffio==1.3.1 # via # anyio - # httpcore # httpx + # openai sqlalchemy==1.3.23 # via # -r requirements.in # pytest-sqlalchemy # shared # sqlalchemy-utils -sqlalchemy-utils==0.36.8 +sqlalchemy-utils==0.41.1 # via # -r requirements.in # pytest-sqlalchemy sqlparse==0.4.4 # via django -statsd==3.3.0 +statsd==4.0.1 # via # -r requirements.in # shared -stripe==2.56.0 +stripe==8.5.0 # via -r requirements.in test-results-parser @ https://github.com/codecov/test-results-parser/archive/5515e960d5d38881036e9127f86320efca649f13.tar.gz # via -r requirements.in -text-unidecode==1.3 - # via faker timeconvert==3.0.13 # via excel-base timestring @ https://github.com/codecov/timestring/archive/d37ceacc5954dff3b5bd2f887936a98a668dda42.tar.gz # via -r requirements.in tlslite-ng==0.8.0b1 # via shared -tqdm==4.66.1 +tqdm==4.66.2 # via openai typing==3.7.4.3 # via shared -typing-extensions==4.6.3 +typing-extensions==4.10.0 # via - # asgiref + # minio # openai # opentelemetry-sdk # pydantic # pydantic-core # shared + # stripe tzdata==2024.1 # via celery tzlocal==5.2 @@ -412,7 +415,6 @@ urllib3==1.26.18 # via # -r requirements.in # botocore - # google-auth # minio # requests # sentry-sdk @@ -424,11 +426,11 @@ vine==5.1.0 # amqp # celery # kombu -virtualenv==20.24.5 +virtualenv==20.25.1 # via pre-commit -wcwidth==0.2.5 +wcwidth==0.2.13 # via prompt-toolkit -wrapt==1.12.1 +wrapt==1.16.0 # via # deprecated # opentelemetry-instrumentation