Use importlib.resources.files() for ToolShed config_schema.yml

This commit is contained in:
Nicola Soranzo
2022-01-19 18:20:21 +00:00
parent bcc505cbbd
commit 60976ec69b
3 changed files with 9 additions and 1 deletions
+1
View File
@@ -65,6 +65,7 @@ from ..version import VERSION_MAJOR, VERSION_MINOR
try:
from importlib.resources import files # type: ignore[attr-defined]
except ImportError:
# Python < 3.9
from importlib_resources import files # type: ignore[no-redef]
if TYPE_CHECKING:
+1
View File
@@ -44,6 +44,7 @@ from galaxy.web_stack import get_app_kwds
try:
from importlib.resources import files # type: ignore[attr-defined]
except ImportError:
# Python < 3.9
from importlib_resources import files # type: ignore[no-redef]
log = logging.getLogger(__name__)
+7 -1
View File
@@ -18,10 +18,16 @@ from galaxy.util import string_as_bool
from galaxy.version import VERSION, VERSION_MAJOR, VERSION_MINOR
from galaxy.web.formatting import expand_pretty_datetime_format
try:
from importlib.resources import files # type: ignore[attr-defined]
except ImportError:
# Python < 3.9
from importlib_resources import files # type: ignore[no-redef]
log = logging.getLogger(__name__)
TOOLSHED_APP_NAME = 'tool_shed'
TOOLSHED_CONFIG_SCHEMA_PATH = 'lib/tool_shed/webapp/config_schema.yml'
TOOLSHED_CONFIG_SCHEMA_PATH = files('tool_shed.webapp') / 'config_schema.yml'
class ToolShedAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):