diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b6b975f..f3b2580 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,8 +10,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.10'] - galaxy-branch: ['release_22.01', 'dev'] + python-version: ['3.8', '3.11'] + galaxy-branch: ['release_23.0', 'dev'] exclude: # this results in lengthy and expensive numpy wheel builds - python-version: '3.10' diff --git a/gravity/config_manager.py b/gravity/config_manager.py index 8ab5c03..394ecb1 100644 --- a/gravity/config_manager.py +++ b/gravity/config_manager.py @@ -7,15 +7,15 @@ import xml.etree.ElementTree as elementtree from typing import Union -from pydantic import ValidationError +try: + from pydantic.v1 import ValidationError +except ImportError: + from pydantic import ValidationError from yaml import safe_load import gravity.io from gravity.settings import Settings -from gravity.state import ( - ConfigFile, - service_for_service_type, -) +from gravity.state import ConfigFile, service_for_service_type from gravity.util import recursive_update log = logging.getLogger(__name__) diff --git a/gravity/settings.py b/gravity/settings.py index 6e3eda4..eeab02f 100644 --- a/gravity/settings.py +++ b/gravity/settings.py @@ -1,13 +1,11 @@ import os from enum import Enum -from typing import ( - Any, - Dict, - List, - Optional, - Union, -) -from pydantic import BaseModel, BaseSettings, Extra, Field, validator +from typing import Any, Dict, List, Optional, Union + +try: + from pydantic.v1 import BaseModel, BaseSettings, Extra, Field, validator +except ImportError: + from pydantic import BaseModel, BaseSettings, Extra, Field, validator DEFAULT_INSTANCE_NAME = "_default_" GX_IT_PROXY_MIN_VERSION = "0.0.6" diff --git a/gravity/state.py b/gravity/state.py index c3c91b6..3879372 100644 --- a/gravity/state.py +++ b/gravity/state.py @@ -2,6 +2,7 @@ state data. """ from __future__ import annotations + import enum import hashlib import os @@ -9,17 +10,15 @@ import time from typing import Any, Dict, List, Optional -from pydantic import BaseModel, validator +try: + from pydantic.v1 import BaseModel, validator +except ImportError: + from pydantic import BaseModel, validator import gravity.io -from gravity.settings import ( - AppServer, - ProcessManager, - ServiceCommandStyle, -) +from gravity.settings import AppServer, ProcessManager, ServiceCommandStyle from gravity.util import http_check - DEFAULT_GALAXY_ENVIRONMENT = { "PYTHONPATH": "lib", "GALAXY_CONFIG_FILE": "{galaxy_conf}", diff --git a/setup.py b/setup.py index 85f74b0..764cdc5 100644 --- a/setup.py +++ b/setup.py @@ -4,8 +4,7 @@ import os import re -from setuptools import setup, find_packages - +from setuptools import find_packages, setup with open("README.rst") as file: long_description = file.read() @@ -36,13 +35,13 @@ def get_var(var_name): author_email="team@galaxyproject.org", license="MIT", keywords="gravity galaxy", - python_requires=">=3.6", + python_requires=">=3.7", install_requires=[ "Click", "supervisor", "pyyaml", "packaging", - "pydantic<2", + "pydantic<3", # pydantic.v1 import will be removed in v3 "jsonref", "requests", "requests-unixsocket", @@ -57,10 +56,10 @@ def get_var(var_name): "Natural Language :: English", "Operating System :: POSIX", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], zip_safe=False, )