diff --git a/.github/workflows/test_conda_store.yaml b/.github/workflows/test_conda_store.yaml index 67269811d..7d728351f 100644 --- a/.github/workflows/test_conda_store.yaml +++ b/.github/workflows/test_conda_store.yaml @@ -40,7 +40,7 @@ jobs: - name: "Set up Python 🐍" uses: actions/setup-python@v5 with: - python-version-file: .python-version-default + python-version: ${{ matrix.python-version }} cache: "pip" - name: "Install Dependencies 📦" diff --git a/.github/workflows/test_conda_store_server_integration.yaml b/.github/workflows/test_conda_store_server_integration.yaml index 4edc6645d..1196c1ca0 100644 --- a/.github/workflows/test_conda_store_server_integration.yaml +++ b/.github/workflows/test_conda_store_server_integration.yaml @@ -30,6 +30,7 @@ jobs: strategy: matrix: test-type: ["playwright", "integration", "user-journey"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] defaults: run: shell: bash -el {0} @@ -38,10 +39,6 @@ jobs: - name: "Checkout Repository 🛎" uses: actions/checkout@v4 - - name: "Get project's default Python version 🏷️" - run: | - echo "PYTHON_VERSION_DEFAULT=$(cat .python-version-default)" >> $GITHUB_ENV - - name: "Set up conda env 🐍" uses: conda-incubator/setup-miniconda@v3 with: @@ -49,7 +46,7 @@ jobs: miniforge-version: latest auto-activate-base: false activate-environment: conda-store-server-dev - python-version: ${{ env.PYTHON_VERSION_DEFAULT }} + python-version: ${{ matrix.python-version }} - name: "Install dependencies 📦" run: | @@ -91,6 +88,14 @@ jobs: python -m pytest -m "user_journey" if: matrix.test-type == 'user-journey' + # These mirror the tests run while building the conda package + # See https://github.com/conda-forge/conda-store-feedstock/ for details + - name: "Run basic import tests ✅" + run: | + python -c "import conda_store_server" + conda-store-server --help + conda-store-worker --help + - name: "Get Docker logs 🔍" if: ${{ failure() }} run: | diff --git a/conda-store-server/conda_store_server/_internal/schema.py b/conda-store-server/conda_store_server/_internal/schema.py index 96dd735d6..87da460ff 100644 --- a/conda-store-server/conda_store_server/_internal/schema.py +++ b/conda-store-server/conda_store_server/_internal/schema.py @@ -8,7 +8,7 @@ import os import re import sys -from typing import Any, Callable, Dict, List, Optional, TypeAlias, Union +from typing import Any, Callable, Dict, List, Optional, Union from conda_lock.lockfile.v1.models import Lockfile from pydantic import BaseModel, Field, ValidationError, constr, validator @@ -36,7 +36,7 @@ def _datetime_factory(offset: datetime.timedelta): # Authentication Schema ######################### -RoleBindings: TypeAlias = Dict[constr(regex=ARN_ALLOWED), List[str]] +RoleBindings = Dict[constr(regex=ARN_ALLOWED), List[str]] class Permissions(enum.Enum): diff --git a/conda-store-server/conda_store_server/_internal/utils.py b/conda-store-server/conda_store_server/_internal/utils.py index 1ad717202..fd073ae84 100644 --- a/conda-store-server/conda_store_server/_internal/utils.py +++ b/conda-store-server/conda_store_server/_internal/utils.py @@ -11,7 +11,7 @@ import subprocess import sys import time -from typing import AnyStr +from typing import AnyStr, Tuple from filelock import FileLock @@ -156,7 +156,7 @@ def callable_or_value(v, *args, **kwargs): def compile_arn_sql_like( arn: str, allowed_regex: re.Pattern[AnyStr] -) -> tuple[str, str]: +) -> Tuple[str, str]: """Turn an arn into a string suitable for use in a SQL LIKE statement. Parameters @@ -172,7 +172,7 @@ def compile_arn_sql_like( Returns ------- - tuple[str, str] + Tuple[str, str] (namespace regex, environment regex) to match in a sql LIKE statement. See conda_store_server.server.auth.Authentication.filter_environments for usage. diff --git a/conda-store-server/conda_store_server/server/auth.py b/conda-store-server/conda_store_server/server/auth.py index d2ee4a43a..d375f992a 100644 --- a/conda-store-server/conda_store_server/server/auth.py +++ b/conda-store-server/conda_store_server/server/auth.py @@ -7,7 +7,7 @@ import re import secrets from collections import defaultdict -from typing import Iterable, Optional, Set +from typing import Iterable, Optional, Set, Tuple import jwt import requests @@ -228,7 +228,7 @@ def compile_arn_regex(arn: str) -> re.Pattern: return re.compile(regex_arn) @staticmethod - def compile_arn_sql_like(arn: str) -> tuple[str, str]: + def compile_arn_sql_like(arn: str) -> Tuple[str, str]: """Turn an arn into a string suitable for use in a SQL LIKE statement. The use of this function is discouraged; use @@ -247,7 +247,7 @@ def compile_arn_sql_like(arn: str) -> tuple[str, str]: Returns ------- - tuple[str, str] + Tuple[str, str] (namespace regex, environment regex) to match in a sql LIKE statement. See conda_store_server.server.auth.Authentication.filter_environments for usage. diff --git a/conda-store-server/environment-dev.yaml b/conda-store-server/environment-dev.yaml index 3e73865e2..23f203e24 100644 --- a/conda-store-server/environment-dev.yaml +++ b/conda-store-server/environment-dev.yaml @@ -13,8 +13,8 @@ channels: - conda-forge - nodefaults dependencies: - # must be kept in sync with .python-version-default - - python=3.12 + # must be kept in sync with the min supported version in pyproject.toml + - python >=3.8 # conda builds - conda # dev dependencies diff --git a/conda-store-server/pyproject.toml b/conda-store-server/pyproject.toml index 318466b03..7e513f818 100644 --- a/conda-store-server/pyproject.toml +++ b/conda-store-server/pyproject.toml @@ -61,7 +61,7 @@ dependencies = [ "pymysql", # pyyaml>5.3.1 is broken with cython>=3 transitive dependency # See https://github.com/yaml/pyyaml/issues/724 for details - "pyyaml==5.3.1", + "pyyaml<=5.3.1", "redis", "requests", "pydantic >=1.10.16,<2.0a0",