diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15b54886..6b002352 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] name: Python ${{ matrix.python-version }} Tests services: @@ -74,11 +74,12 @@ jobs: - name: Install dependencies run: | + pip install setuptools pip install .[test] if: steps.cache.outputs.cache-hit != 'true' - name: Tests - run: protean test -c WITH_COVERAGE + run: pytest --slow --sqlite --postgresql --elasticsearch --redis --cov=protean --cov-config .coveragerc tests env: TEST_CMD: pre-commit run --all-files POSTGRES_PASSWORD: postgres diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f11bafc..4ca463e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,15 +5,14 @@ repos: - id: black language_version: python3.8 - - repo: git@github.com:humitos/mirrors-autoflake.git - rev: v1.3 + - repo: git@github.com:PyCQA/autoflake.git + rev: v2.2.1 hooks: - id: autoflake args: [ "--in-place", "--remove-all-unused-imports", - "--remove-unused-variable", "--ignore-init-module-imports", ] diff --git a/setup.py b/setup.py index 1512a292..0052baec 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,10 @@ def read(*names, **kwargs): ).read() -elasticsearch_requires = ["elasticsearch>=7.13.1", "elasticsearch-dsl>=7.3.0"] +# Elasticsearch is tied to version 7.x because while 8.x supports sync and async workflows +# in the same client, it introduces breaking changes in the API. +elasticsearch_requires = ["elasticsearch~=7.17.9", "elasticsearch-dsl~=7.4.1"] + redis_requires = ["redis==3.5.2"] sqlite_requires = ["sqlalchemy==1.4.47"] postgresql_requires = ["psycopg2>=2.8.4", "sqlalchemy==1.4.47"] @@ -54,7 +57,7 @@ def read(*names, **kwargs): ] testing_requires = all_external_requires + [ - "autoflake>=1.4", + "autoflake>=2.2.1", "isort>=5.10.1", "mock==4.0.2", "pluggy==0.13.1", @@ -120,8 +123,11 @@ def read(*names, **kwargs): "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", + "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Application Frameworks", diff --git a/tests/adapters/repository/sqlalchemy_repo/postgresql/test_schema_switch.py b/tests/adapters/repository/sqlalchemy_repo/postgresql/test_schema_switch.py index 6ec72255..e8a19ff6 100644 --- a/tests/adapters/repository/sqlalchemy_repo/postgresql/test_schema_switch.py +++ b/tests/adapters/repository/sqlalchemy_repo/postgresql/test_schema_switch.py @@ -5,7 +5,7 @@ from .elements import Person -# @pytest.mark.postgresql +@pytest.mark.postgresql class TestSchemaSwitch: @pytest.fixture(autouse=True) def register_elements(self, test_domain): diff --git a/tests/repository/test_repository_registration.py b/tests/repository/test_repository_registration.py index 5fb00e8e..855f2ce0 100644 --- a/tests/repository/test_repository_registration.py +++ b/tests/repository/test_repository_registration.py @@ -115,6 +115,7 @@ def special_method(self): == "GenericUserRepository" ) + @pytest.mark.elasticsearch def test_retrieving_the_database_specific_repository(self, test_domain): test_domain.config["DATABASES"]["secondary"] = { "PROVIDER": "protean.adapters.repository.elasticsearch.ESProvider",