From 8157f0a3bdc444a4ebad5e8bbc7f7e1e0a279ab8 Mon Sep 17 00:00:00 2001 From: pdmurray Date: Mon, 11 Nov 2024 13:37:45 -0800 Subject: [PATCH] Remove support for Python 3.8 and 3.9 --- .github/workflows/test_conda_store.yaml | 6 +++--- .../test_conda_store_server_integration.yaml | 4 ++-- .../conda_store_server/_internal/schema.py | 7 ++++--- .../conda_store_server/_internal/utils.py | 8 +++++--- .../conda_store_server/server/auth.py | 7 ++++--- conda-store-server/pyproject.toml | 7 ++++--- .../tests/user_journeys/utils/api_utils.py | 11 ++++++----- docker-compose.yaml | 4 ++++ recipe/meta.yaml | 18 ++++++++++-------- 9 files changed, 42 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test_conda_store.yaml b/.github/workflows/test_conda_store.yaml index 7d728351f..d787fcf64 100644 --- a/.github/workflows/test_conda_store.yaml +++ b/.github/workflows/test_conda_store.yaml @@ -32,7 +32,7 @@ jobs: working-directory: conda-store strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] steps: - name: "Checkout Repository 🛎" uses: actions/checkout@v4 @@ -40,7 +40,7 @@ jobs: - name: "Set up Python 🐍" uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version-file: .python-version-default cache: "pip" - name: "Install Dependencies 📦" @@ -56,7 +56,7 @@ jobs: - name: "Deploy docker compose 🏗️" run: | - docker compose up -d + python_version=${{ matrix.python-version }} docker compose up --build -d docker ps wait-for-it localhost:5432 # postgresql diff --git a/.github/workflows/test_conda_store_server_integration.yaml b/.github/workflows/test_conda_store_server_integration.yaml index 31e3d14c2..78ead6901 100644 --- a/.github/workflows/test_conda_store_server_integration.yaml +++ b/.github/workflows/test_conda_store_server_integration.yaml @@ -30,7 +30,7 @@ jobs: strategy: matrix: test-type: ["playwright", "integration", "user-journey"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] defaults: run: shell: bash -el {0} @@ -57,7 +57,7 @@ jobs: - name: "Deploy docker compose 🏗️" run: | - docker compose up -d + python_version=${{ matrix.python-version }} docker compose up --build -d docker ps wait-for-it localhost:5432 # postgresql diff --git a/conda-store-server/conda_store_server/_internal/schema.py b/conda-store-server/conda_store_server/_internal/schema.py index 87da460ff..1a9f692c6 100644 --- a/conda-store-server/conda_store_server/_internal/schema.py +++ b/conda-store-server/conda_store_server/_internal/schema.py @@ -8,7 +8,8 @@ import os import re import sys -from typing import Any, Callable, Dict, List, Optional, Union +from collections.abc import Callable +from typing import Any, Dict, List, Optional, TypeAlias, Union from conda_lock.lockfile.v1.models import Lockfile from pydantic import BaseModel, Field, ValidationError, constr, validator @@ -36,7 +37,7 @@ def _datetime_factory(offset: datetime.timedelta): # Authentication Schema ######################### -RoleBindings = Dict[constr(regex=ARN_ALLOWED), List[str]] +RoleBindings: TypeAlias = Dict[constr(regex=ARN_ALLOWED), List[str]] class Permissions(enum.Enum): @@ -129,7 +130,7 @@ class Config: @classmethod def from_list(cls, lst): - return cls(**{k: v for k, v in zip(cls.__fields__.keys(), lst)}) + return cls(**{k: v for k, v in zip(cls.__fields__.keys(), lst, strict=False)}) class Namespace(BaseModel): diff --git a/conda-store-server/conda_store_server/_internal/utils.py b/conda-store-server/conda_store_server/_internal/utils.py index e4162ac84..1ad717202 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 Tuple +from typing import AnyStr from filelock import FileLock @@ -154,7 +154,9 @@ def callable_or_value(v, *args, **kwargs): return v -def compile_arn_sql_like(arn: str, allowed_regex: re.Pattern) -> Tuple[str, str]: +def compile_arn_sql_like( + arn: str, allowed_regex: re.Pattern[AnyStr] +) -> tuple[str, str]: """Turn an arn into a string suitable for use in a SQL LIKE statement. Parameters @@ -170,7 +172,7 @@ def compile_arn_sql_like(arn: str, allowed_regex: re.Pattern) -> 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/conda_store_server/server/auth.py b/conda-store-server/conda_store_server/server/auth.py index d375f992a..1515197db 100644 --- a/conda-store-server/conda_store_server/server/auth.py +++ b/conda-store-server/conda_store_server/server/auth.py @@ -7,7 +7,8 @@ import re import secrets from collections import defaultdict -from typing import Iterable, Optional, Set, Tuple +from collections.abc import Iterable +from typing import Optional, Set import jwt import requests @@ -228,7 +229,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 +248,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/pyproject.toml b/conda-store-server/pyproject.toml index 7e513f818..f01c39b4d 100644 --- a/conda-store-server/pyproject.toml +++ b/conda-store-server/pyproject.toml @@ -11,7 +11,7 @@ name = "conda-store-server" description = "Conda Environment Management, Builds, and Serve" readme = "README.md" license = "BSD-3-Clause" -requires-python = ">=3.8" +requires-python = ">=3.10,<3.13" keywords = ["conda"] authors = [ { name = "Christopher Ostrouchov", email = "chris.ostrouchov@gmail.com" }, @@ -19,6 +19,7 @@ authors = [ maintainers = [ { name = "Tania Allard", email = "trallard@bitsandchips.me" }, { name = "Pavithra Eswaramoorthy", email = "pavithraes@outlook.com" }, + { name = "Peyton Murray", email = "peynmurray@gmail.com" }, ] classifiers = [ "Development Status :: 3 - Alpha", @@ -26,8 +27,6 @@ classifiers = [ "Topic :: Software Development :: Build Tools", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", - "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", @@ -192,6 +191,8 @@ ignore = [ "UP007", # non-pep604-annotation "UP030", # format-literals "UP031", # printf-string-formatting + "UP035", # deprecated-import + "UP038", # non-pep604-isinstance ] select = [ "E", # pycodestyle diff --git a/conda-store-server/tests/user_journeys/utils/api_utils.py b/conda-store-server/tests/user_journeys/utils/api_utils.py index ceec96df1..f7c86c21e 100644 --- a/conda-store-server/tests/user_journeys/utils/api_utils.py +++ b/conda-store-server/tests/user_journeys/utils/api_utils.py @@ -7,8 +7,9 @@ import json import time import uuid +from collections.abc import Callable from enum import Enum -from typing import Any, Callable, Dict, Optional, Union +from typing import Any, Dict, Optional, Union import requests @@ -251,7 +252,7 @@ def get_builds( self, environment: Optional[str] = None, namespace: Optional[str] = None, - ) -> Dict[str, Any]: + ) -> dict[str, Any]: """Get information about an environment. Parameters @@ -263,7 +264,7 @@ def get_builds( Returns ------- - Dict[str, Any] + dict[str, Any] Dict of build properties; see API docs for api/v1/build/ for more information. """ @@ -278,7 +279,7 @@ def get_builds( "data" ] - def get_environment(self, namespace: str, environment: str) -> Dict[str, Any]: + def get_environment(self, namespace: str, environment: str) -> dict[str, Any]: """Get information about an environment. Parameters @@ -290,7 +291,7 @@ def get_environment(self, namespace: str, environment: str) -> Dict[str, Any]: Returns ------- - Dict[str, Any] + dict[str, Any] Dict of environment properties; see API docs for api/v1/environment/{namespace}/{environment}/ for more information. """ diff --git a/docker-compose.yaml b/docker-compose.yaml index 33ec36d38..788a13361 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,6 +3,8 @@ services: build: context: conda-store-server target: dev + args: + python_version=$python_version user: 1000:1000 volumes: - ./tests/assets/environments:/opt/environments:ro @@ -22,6 +24,8 @@ services: build: context: conda-store-server target: dev + args: + python_version=$python_version user: 1000:1000 depends_on: postgres: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index abb967f1f..1df86ebfb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -4,7 +4,7 @@ {% set name = "conda-store" %} # version MUST be updated when a new release is made -{% set version = "2024.6.1" %} +{% set version = "2024.11.1" %} package: name: {{ name|lower }}-split @@ -27,7 +27,7 @@ outputs: - conda-store = conda_store.__main__:main requirements: host: - - python >=3.8 + - python >=3.10,<3.13 - pip - hatchling >=1.14.0 - hatch-vcs @@ -35,9 +35,9 @@ outputs: - __linux # [linux] - __osx # [osx] - __win # [win] - - aiohttp>=3.8.1 + - aiohttp >=3.8.1 - click - - python >=3.8 + - python >=3.10,<3.13 - rich - ruamel.yaml - yarl @@ -60,7 +60,7 @@ outputs: - conda-store-worker = conda_store_server._internal.worker.__main__:main requirements: host: - - python >=3.8 + - python >=3.10,<3.13 - pip - hatchling >=1.14.0 - hatch-vcs @@ -82,10 +82,10 @@ outputs: - minio - pydantic <2.0a0 - pyjwt - - python >=3.8 + - python >=3.10,<3.13 - python-docker - python-multipart - - pyyaml + - pyyaml <=5.3.1 - redis-py - requests - sqlalchemy <2.0a0 @@ -115,11 +115,13 @@ about: philosophy of conda-store is to serve identical conda environments in as many ways as possible. Conda Store controls the environment lifecycle: management, builds, and serving of environments. - doc_url: https://conda.store + doc_url: https://conda.store/ dev_url: https://github.com/conda-incubator/conda-store extra: feedstock-name: conda-store recipe-maintainers: + - peytondmurray + - soapy1 - trallard - jaimergp