From f2f9554d4a255e1bb235e882d9a5469e68d55349 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Tue, 2 Apr 2024 12:51:33 +0200 Subject: [PATCH] tests: update test matrix * pytest-black -> pytest-black-ng since former is unsupported --- .github/workflows/tests.yml | 36 ++++++++---------------------------- setup.cfg | 6 +++--- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f494dfac..50f53d4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,7 +2,7 @@ # # This file is part of Invenio. # Copyright (C) 2020 CERN. -# Copyright (C) 2022 Graz University of Technology. +# Copyright (C) 2022-2024 Graz University of Technology. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -29,55 +29,35 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.8, 3.9] + python-version: ["3.9", "3.12"] requirements-level: [pypi] db-service: [postgresql14, mysql8] include: - db-service: postgresql14 DB: postgresql - POSTGRESQL_VERSION: POSTGRESQL_14_LATEST - SQLALCHEMY_DATABASE_URI: "postgresql+psycopg2://invenio:invenio@localhost:5432/invenio" - EXTRAS: "tests,postgresql" - db-service: mysql8 DB: mysql - MYSQL_VERSION: MYSQL_8_LATEST - SQLALCHEMY_DATABASE_URI: "mysql+pymysql://invenio:invenio@localhost:3306/invenio" - EXTRAS: "tests,mysql" env: - SQLALCHEMY_DATABASE_URI: ${{matrix.SQLALCHEMY_DATABASE_URI}} - POSTGRESQL_VERSION: ${{matrix.POSTGRESQL_VERSION}} - MYSQL_VERSION: ${{matrix.MYSQL_VERSION}} DB: ${{ matrix.DB }} - + EXTRAS: tests,${{ matrix.DB }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - - name: Generate dependencies - run: | - pip install wheel requirements-builder - requirements-builder -e ${{ matrix.EXTRAS }} --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt - - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }} + cache: pip + cache-dependency-path: setup.cfg - name: Install dependencies run: | - pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt - pip install .[${{ matrix.EXTRAS }}] + pip install .[$EXTRAS] pip freeze docker --version - docker-compose --version - name: Run tests run: | diff --git a/setup.cfg b/setup.cfg index 440f3491..9a87c44d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ # This file is part of Invenio. # Copyright (C) 2015-2022 CERN. # Copyright (C) 2021 TU Wien. -# Copyright (C) 2022 Graz University of Technology. +# Copyright (C) 2022-2024 Graz University of Technology. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -38,8 +38,8 @@ install_requires = [options.extras_require] tests = - pytest-black>=0.3.0 - invenio-admin>=1.4.0,<2.0.0 + invenio-admin>=1.2.1,<2.0.0 + pytest-black-ng>=0.4.0 pytest-invenio>=2.1.0,<3.0.0 pytest-mock>=1.6.0 sphinx>=4.5.0