devservices 1.0.14__tar.gz → 1.0.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {devservices-1.0.14 → devservices-1.0.15}/PKG-INFO +1 -1
- {devservices-1.0.14 → devservices-1.0.15}/README.md +1 -1
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/update.py +1 -1
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/dependencies.py +22 -1
- {devservices-1.0.14 → devservices-1.0.15}/devservices.egg-info/PKG-INFO +1 -1
- {devservices-1.0.14 → devservices-1.0.15}/pyproject.toml +1 -1
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_dependencies.py +35 -2
- {devservices-1.0.14 → devservices-1.0.15}/LICENSE.md +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/__init__.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/__init__.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/down.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/list_dependencies.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/list_services.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/logs.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/purge.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/status.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/commands/up.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/configs/service_config.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/constants.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/exceptions.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/main.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/__init__.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/check_for_update.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/console.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/devenv.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/docker.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/docker_compose.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/file_lock.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/git.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/install_binary.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/services.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices/utils/state.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices.egg-info/SOURCES.txt +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices.egg-info/dependency_links.txt +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices.egg-info/entry_points.txt +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices.egg-info/requires.txt +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/devservices.egg-info/top_level.txt +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/setup.cfg +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/testing/__init__.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/testing/utils.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/__init__.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_down.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_list_dependencies.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_list_services.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_logs.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_purge.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_status.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_up.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/commands/test_update.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/configs/test_service_config.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/conftest.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_check_for_update.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_docker.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_docker_compose.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_git.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_install_binary.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_services.py +0 -0
- {devservices-1.0.14 → devservices-1.0.15}/tests/utils/test_state.py +0 -0
|
@@ -36,7 +36,7 @@ def update_version(exec_path: str, latest_version: str) -> None:
|
|
|
36
36
|
|
|
37
37
|
def add_parser(subparsers: _SubParsersAction[ArgumentParser]) -> None:
|
|
38
38
|
parser = subparsers.add_parser(
|
|
39
|
-
"update", help="
|
|
39
|
+
"update", help="Update devservices to the latest version"
|
|
40
40
|
)
|
|
41
41
|
parser.set_defaults(func=update)
|
|
42
42
|
|
|
@@ -272,6 +272,17 @@ def get_non_shared_remote_dependencies(
|
|
|
272
272
|
active_services = starting_services.union(started_services)
|
|
273
273
|
# We don't care about the remote dependencies of the service we are stopping
|
|
274
274
|
active_services.remove(service_to_stop.name)
|
|
275
|
+
|
|
276
|
+
active_modes: dict[str, list[str]] = dict()
|
|
277
|
+
for active_service in active_services:
|
|
278
|
+
starting_modes = state.get_active_modes_for_service(
|
|
279
|
+
active_service, StateTables.STARTING_SERVICES
|
|
280
|
+
)
|
|
281
|
+
started_modes = state.get_active_modes_for_service(
|
|
282
|
+
active_service, StateTables.STARTED_SERVICES
|
|
283
|
+
)
|
|
284
|
+
active_modes[active_service] = starting_modes or started_modes
|
|
285
|
+
|
|
275
286
|
other_running_remote_dependencies: set[InstalledRemoteDependency] = set()
|
|
276
287
|
base_running_service_names: set[str] = set()
|
|
277
288
|
for started_service_name in active_services:
|
|
@@ -279,8 +290,18 @@ def get_non_shared_remote_dependencies(
|
|
|
279
290
|
for dependency_name in service_to_stop.config.dependencies.keys():
|
|
280
291
|
if dependency_name == started_service.config.service_name:
|
|
281
292
|
base_running_service_names.add(started_service_name)
|
|
293
|
+
|
|
294
|
+
started_service_modes = active_modes[started_service_name]
|
|
295
|
+
# Only consider the dependencies of the modes that are running
|
|
296
|
+
started_service_dependencies: dict[str, Dependency] = dict()
|
|
297
|
+
for started_service_mode in started_service_modes:
|
|
298
|
+
for dependency_name in started_service.config.modes[started_service_mode]:
|
|
299
|
+
started_service_dependencies[
|
|
300
|
+
dependency_name
|
|
301
|
+
] = started_service.config.dependencies[dependency_name]
|
|
302
|
+
|
|
282
303
|
installed_remote_dependencies = get_installed_remote_dependencies(
|
|
283
|
-
list(
|
|
304
|
+
list(started_service_dependencies.values())
|
|
284
305
|
)
|
|
285
306
|
# TODO: There is an edge case here where there is a shared remote dependency with different modes
|
|
286
307
|
other_running_remote_dependencies = other_running_remote_dependencies.union(
|
|
@@ -2164,6 +2164,8 @@ def test_get_non_shared_remote_dependencies_shared_dependencies(
|
|
|
2164
2164
|
),
|
|
2165
2165
|
)
|
|
2166
2166
|
assert len(shared_remote_dependencies) == 0
|
|
2167
|
+
mock_find_matching_service.assert_called_once_with("service-2")
|
|
2168
|
+
mock_get_installed_remote_dependencies.assert_called_once_with([])
|
|
2167
2169
|
|
|
2168
2170
|
|
|
2169
2171
|
@mock.patch(
|
|
@@ -2186,8 +2188,25 @@ def test_get_non_shared_remote_dependencies_shared_dependencies(
|
|
|
2186
2188
|
config=ServiceConfig(
|
|
2187
2189
|
version=0.1,
|
|
2188
2190
|
service_name="service-2",
|
|
2189
|
-
dependencies={
|
|
2190
|
-
|
|
2191
|
+
dependencies={
|
|
2192
|
+
"dependency-3": Dependency(
|
|
2193
|
+
description="dependency-3",
|
|
2194
|
+
remote=RemoteConfig(
|
|
2195
|
+
repo_name="dependency-3",
|
|
2196
|
+
repo_link="file://path/to/dependency-3",
|
|
2197
|
+
branch="main",
|
|
2198
|
+
),
|
|
2199
|
+
),
|
|
2200
|
+
"dependency-4": Dependency(
|
|
2201
|
+
description="dependency-4",
|
|
2202
|
+
remote=RemoteConfig(
|
|
2203
|
+
repo_name="dependency-4",
|
|
2204
|
+
repo_link="file://path/to/dependency-4",
|
|
2205
|
+
branch="main",
|
|
2206
|
+
),
|
|
2207
|
+
),
|
|
2208
|
+
},
|
|
2209
|
+
modes={"default": ["dependency-3"], "other": ["dependency-4"]},
|
|
2191
2210
|
),
|
|
2192
2211
|
),
|
|
2193
2212
|
)
|
|
@@ -2252,6 +2271,20 @@ def test_get_non_shared_remote_dependencies_complex(
|
|
|
2252
2271
|
mode="default",
|
|
2253
2272
|
)
|
|
2254
2273
|
}
|
|
2274
|
+
mock_find_matching_service.assert_called_once_with("service-2")
|
|
2275
|
+
# dependency-4 is not installed, so it should not be passed to get_installed_remote_dependencies
|
|
2276
|
+
mock_get_installed_remote_dependencies.assert_called_once_with(
|
|
2277
|
+
[
|
|
2278
|
+
Dependency(
|
|
2279
|
+
description="dependency-3",
|
|
2280
|
+
remote=RemoteConfig(
|
|
2281
|
+
repo_name="dependency-3",
|
|
2282
|
+
repo_link="file://path/to/dependency-3",
|
|
2283
|
+
branch="main",
|
|
2284
|
+
),
|
|
2285
|
+
)
|
|
2286
|
+
]
|
|
2287
|
+
)
|
|
2255
2288
|
|
|
2256
2289
|
|
|
2257
2290
|
@mock.patch("devservices.utils.dependencies.install_dependencies", return_value=[])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|