Skip to content

Commit fd94699

Browse files
committed
Replace galaxy-lib dependency with galaxy-tool-util.
galaxy-lib is now unmaintained. We're managing the decomposition of the project from inside of the core codebase to prevent drift.
1 parent ead263d commit fd94699

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+59
-53
lines changed

README.rst

+4-4

cwltool/software_requirements.py

+19-13
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
from .builder import Builder, HasReqsHints
2020
try:
21-
from galaxy.tools.deps.requirements import ToolRequirement, ToolRequirements
22-
from galaxy.tools import deps
21+
from galaxy.tool_util.deps.requirements import ToolRequirement, ToolRequirements
22+
from galaxy.tool_util import deps
2323
except ImportError:
2424
ToolRequirement = None # type: ignore
2525
ToolRequirements = None # type: ignore
@@ -49,25 +49,30 @@ def __init__(self, args):
4949
self.tool_dependency_dir = tool_dependency_dir
5050
self.dependency_resolvers_config_file = os.path.abspath(conf_file)
5151
elif conda_dependencies is not None:
52-
if not tool_dependency_dir is not None:
52+
if tool_dependency_dir is None:
5353
tool_dependency_dir = os.path.abspath("./cwltool_deps")
5454
self.tool_dependency_dir = tool_dependency_dir
5555
self.use_tool_dependencies = True
5656
self.dependency_resolvers_config_file = None
5757
else:
5858
self.use_tool_dependencies = False
5959

60-
@property
61-
def config_dict(self): # type: () -> Dict[Text, bool]
62-
return {
63-
'conda_auto_install': True,
64-
'conda_auto_init': True,
65-
}
66-
6760
def build_job_script(self, builder, command):
6861
# type: (Builder, List[str]) -> Text
6962
ensure_galaxy_lib_available()
70-
tool_dependency_manager = deps.build_dependency_manager(self) # type: deps.DependencyManager
63+
resolution_config_dict = {
64+
'use': self.use_tool_dependencies,
65+
'default_base_path': self.tool_dependency_dir,
66+
}
67+
app_config = {
68+
'conda_auto_install': True,
69+
'conda_auto_init': True,
70+
}
71+
tool_dependency_manager = deps.build_dependency_manager(
72+
app_config_dict=app_config,
73+
resolution_config_dict=resolution_config_dict,
74+
conf_file=self.dependency_resolvers_config_file,
75+
) # type: deps.DependencyManager
7176
dependencies = get_dependencies(builder)
7277
handle_dependencies = "" # str
7378
if dependencies:
@@ -107,10 +112,11 @@ def get_container_from_software_requirements(use_biocontainers, builder):
107112
# type: (bool, HasReqsHints) -> Optional[Text]
108113
if use_biocontainers:
109114
ensure_galaxy_lib_available()
110-
from galaxy.tools.deps.containers import ContainerRegistry, AppInfo, ToolInfo, DOCKER_CONTAINER_TYPE
115+
from galaxy.tool_util.deps.dependencies import AppInfo, ToolInfo
116+
from galaxy.tool_util.deps.containers import ContainerRegistry, DOCKER_CONTAINER_TYPE
111117
app_info = AppInfo(
112118
involucro_auto_init=True,
113-
enable_beta_mulled_containers=True,
119+
enable_mulled_containers=True,
114120
container_image_cache_path=".",
115121
) # type: AppInfo
116122
container_registry = ContainerRegistry(app_info) # type: ContainerRegistry

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
extras_require={
8181
':os.name=="posix" and python_version<"3.5"': ['subprocess32 >= 3.5.0'],
8282
':python_version<"3.6"': ['typing >= 3.5.3'],
83-
'deps': ["galaxy-lib >= 17.09.9, <= 18.9.2 "],
83+
'deps': ["galaxy-tool-util"],
8484
'docs': ["sphinx >= 2.2", "sphinx-rtd-theme"],
8585
},
8686
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',

tests/test_deps_env/random-lines/1.0/scripts/random-lines

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __main__():
6565
writer = output.write
6666
for line_offset in line_offsets:
6767
seeker( line_offset )
68-
writer( readliner() )
68+
writer( readliner().decode("utf-8") )
6969
input.close()
7070
output.close()
7171
#print("Kept %i of %i total lines." % ( num_lines, total_lines ))

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ deps =
3737
py{27,35,36,37,38}-unit: pytest-xdist<1.28.0
3838
py{27,35,36,37,38}-unit: pytest-cov
3939
py{27,35,36,37,38}-unit: -rtest-requirements.txt
40-
py{27,35,36,37,38}-unit: galaxy-lib
40+
py{27,35,36,37,38}-unit: galaxy-tool-util
4141
py{27,35,36,37,38}-lint: flake8
4242
py{27,35,36,37,38}-bandit: bandit
4343
py{35,36,36,37,38}-mypy{2,3}: mypy==0.720

typeshed/2and3/galaxy/tools/deps/__init__.pyi renamed to typeshed/2and3/galaxy/tool_util/deps/__init__.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ from .resolvers.tool_shed_packages import ToolShedPackageDependencyResolver as T
1212
log = ... # type: Any
1313
CONFIG_VAL_NOT_FOUND = ... # type: Any
1414

15-
def build_dependency_manager(config: Any) -> DependencyManager: ...
15+
def build_dependency_manager(app_config_dict: Any, resolution_config_dict: Any, conf_file: Any) -> DependencyManager: ...
1616

1717
class NullDependencyManager:
1818
dependency_resolvers = ... # type: Any

typeshed/2and3/galaxy/tools/deps/containers.pyi renamed to typeshed/2and3/galaxy/tool_util/deps/containers.pyi

-19
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,6 @@ class ContainerRegistry:
3535
def __init__(self, app_info) -> None: ...
3636
def find_best_container_description(self, enabled_container_types, tool_info) -> ContainerDescription: ...
3737

38-
class AppInfo:
39-
galaxy_root_dir = ... # type: Any
40-
default_file_path = ... # type: Any
41-
outputs_to_working_directory = ... # type: Any
42-
container_image_cache_path = ... # type: Any
43-
library_import_dir = ... # type: Any
44-
enable_beta_mulled_containers = ... # type: Any
45-
containers_resolvers_config_file = ... # type: Any
46-
involucro_path = ... # type: Any
47-
involucro_auto_init = ... # type: Any
48-
def __init__(self, galaxy_root_dir: Optional[Any] = ..., default_file_path: Optional[Any] = ..., outputs_to_working_directory: bool = ..., container_image_cache_path: Optional[Any] = ..., library_import_dir: Optional[Any] = ..., enable_beta_mulled_containers: bool = ..., containers_resolvers_config_file: Optional[Any] = ..., involucro_path: Optional[Any] = ..., involucro_auto_init: bool = ...) -> None: ...
49-
50-
class ToolInfo:
51-
container_descriptions = ... # type: Any
52-
requirements = ... # type: Any
53-
requires_galaxy_python_environment = ... # type: Any
54-
env_pass_through = ... # type: Any
55-
def __init__(self, container_descriptions: Any = ..., requirements: Any = ..., requires_galaxy_python_environment: bool = ...) -> None: ...
56-
5738
class JobInfo:
5839
working_directory = ... # type: Any
5940
job_directory = ... # type: Any
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Stubs for galaxy.tools.deps.dependencies (Python 3.4)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any, Optional
6+
7+
class AppInfo:
8+
galaxy_root_dir = ... # type: Any
9+
default_file_path = ... # type: Any
10+
outputs_to_working_directory = ... # type: Any
11+
container_image_cache_path = ... # type: Any
12+
library_import_dir = ... # type: Any
13+
enable_mulled_containers = ... # type: Any
14+
containers_resolvers_config_file = ... # type: Any
15+
involucro_path = ... # type: Any
16+
involucro_auto_init = ... # type: Any
17+
def __init__(self, galaxy_root_dir: Optional[Any] = ..., default_file_path: Optional[Any] = ..., outputs_to_working_directory: bool = ..., container_image_cache_path: Optional[Any] = ..., library_import_dir: Optional[Any] = ..., enable_mulled_containers: bool = ..., containers_resolvers_config_file: Optional[Any] = ..., involucro_path: Optional[Any] = ..., involucro_auto_init: bool = ...) -> None: ...
18+
19+
class DependenciesDescription:
20+
requirements = ... # type: Any
21+
installed_tool_dependencies = ... # type: Any
22+
def __init__(self, requirements: Any = ..., installed_tool_dependencies: Any = ...) -> None: ...
23+
def to_dict(self): ...
24+
@staticmethod
25+
def from_dict(as_dict): ...
26+
27+
class ToolInfo:
28+
container_descriptions = ... # type: Any
29+
requirements = ... # type: Any
30+
requires_galaxy_python_environment = ... # type: Any
31+
env_pass_through = ... # type: Any
32+
def __init__(self, container_descriptions: Any = ..., requirements: Any = ..., requires_galaxy_python_environment: bool = ...) -> None: ...

typeshed/2and3/galaxy/tools/deps/dependencies.pyi

-13
This file was deleted.

0 commit comments

Comments
 (0)