Skip to content

Commit

Permalink
fix(python): 3.8 compatibility and CI multi-version [skip-bc] (genera…
Browse files Browse the repository at this point in the history
…ted)

algolia/api-clients-automation#3613

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Clément Vannicatte <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
3 people committed Aug 29, 2024
1 parent 1be63d2 commit f3d8ad8
Show file tree
Hide file tree
Showing 548 changed files with 3,971 additions and 554 deletions.
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
from __future__ import annotations

from json import dumps
from typing import Annotated, Any, Dict, List, Optional, Self, Tuple, Union
from sys import version_info
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import quote

from pydantic import Field, StrictInt, StrictStr

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self

from algoliasearch.abtesting.config import AbtestingConfig
from algoliasearch.abtesting.models.ab_test import ABTest
from algoliasearch.abtesting.models.ab_test_response import ABTestResponse
Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/ab_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, List, Optional, Self, Union
from sys import version_info
from typing import Any, Dict, List, Optional, Union

from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


from algoliasearch.abtesting.models.ab_test_configuration import ABTestConfiguration
from algoliasearch.abtesting.models.status import Status
from algoliasearch.abtesting.models.variant import Variant
Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/ab_test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


from algoliasearch.abtesting.models.empty_search import EmptySearch
from algoliasearch.abtesting.models.minimum_detectable_effect import (
MinimumDetectableEffect,
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/ab_test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Self
from sys import version_info
from typing import Any, Dict

from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class ABTestResponse(BaseModel):
"""
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/ab_tests_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Annotated, Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictStr

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self


class AbTestsVariant(BaseModel):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Annotated, Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictStr

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self


class AbTestsVariantSearchParams(BaseModel):
"""
Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/add_ab_tests_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Annotated, Any, Dict, List, Self
from sys import version_info
from typing import Any, Dict, List

from pydantic import BaseModel, ConfigDict, Field, StrictStr

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self


from algoliasearch.abtesting.models.add_ab_tests_variant import AddABTestsVariant


Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/add_ab_tests_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import dumps
from typing import Dict, Optional, Self, Union
from sys import version_info
from typing import Dict, Optional, Union

from pydantic import BaseModel, ValidationError, model_serializer

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


from algoliasearch.abtesting.models.ab_tests_variant import AbTestsVariant
from algoliasearch.abtesting.models.ab_tests_variant_search_params import (
AbTestsVariantSearchParams,
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self, Union
from sys import version_info
from typing import Any, Dict, Optional, Union

from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class Currency(BaseModel):
"""
Expand Down
7 changes: 6 additions & 1 deletion algoliasearch/abtesting/models/effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

from enum import Enum
from json import loads
from typing import Self
from sys import version_info

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class Effect(str, Enum):
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/empty_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictBool

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class EmptySearch(BaseModel):
"""
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/empty_search_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictInt

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class EmptySearchFilter(BaseModel):
"""
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/error_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, ClassVar, Dict, List, Optional, Self
from sys import version_info
from typing import Any, ClassVar, Dict, List, Optional

from pydantic import BaseModel, ConfigDict, StrictStr

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class ErrorBase(BaseModel):
"""
Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/filter_effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


from algoliasearch.abtesting.models.empty_search_filter import EmptySearchFilter
from algoliasearch.abtesting.models.outliers_filter import OutliersFilter

Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/list_ab_tests_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, List, Optional, Self
from sys import version_info
from typing import Any, Dict, List, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictInt

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


from algoliasearch.abtesting.models.ab_test import ABTest


Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/minimum_detectable_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Annotated, Any, Dict, Optional, Self, Union
from sys import version_info
from typing import Any, Dict, Optional, Union

from pydantic import BaseModel, ConfigDict, Field

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self


from algoliasearch.abtesting.models.effect import Effect


Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/outliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictBool

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class Outliers(BaseModel):
"""
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/outliers_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Optional, Self
from sys import version_info
from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field, StrictInt

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class OutliersFilter(BaseModel):
"""
Expand Down
8 changes: 7 additions & 1 deletion algoliasearch/abtesting/models/schedule_ab_test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
from __future__ import annotations

from json import loads
from typing import Any, Dict, Self
from sys import version_info
from typing import Any, Dict

from pydantic import BaseModel, ConfigDict, Field, StrictInt

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class ScheduleABTestResponse(BaseModel):
"""
Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/schedule_ab_tests_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Annotated, Any, Dict, List, Self
from sys import version_info
from typing import Any, Dict, List

from pydantic import BaseModel, ConfigDict, Field, StrictStr

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self


from algoliasearch.abtesting.models.add_ab_tests_variant import AddABTestsVariant


Expand Down
7 changes: 6 additions & 1 deletion algoliasearch/abtesting/models/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@

from enum import Enum
from json import loads
from typing import Self
from sys import version_info

if version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self


class Status(str, Enum):
Expand Down
9 changes: 8 additions & 1 deletion algoliasearch/abtesting/models/variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from __future__ import annotations

from json import loads
from typing import Annotated, Any, Dict, Optional, Self, Union
from sys import version_info
from typing import Any, Dict, Optional, Union

from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr

if version_info >= (3, 11):
from typing import Annotated, Self
else:
from typing_extensions import Annotated, Self


from algoliasearch.abtesting.models.currency import Currency
from algoliasearch.abtesting.models.filter_effects import FilterEffects

Expand Down
Loading

0 comments on commit f3d8ad8

Please sign in to comment.