cook-build 0.7.0__tar.gz → 0.7.1__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.
- {cook_build-0.7.0/src/cook_build.egg-info → cook_build-0.7.1}/PKG-INFO +1 -1
- {cook_build-0.7.0 → cook_build-0.7.1}/pyproject.toml +1 -1
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/task.py +4 -4
- {cook_build-0.7.0 → cook_build-0.7.1/src/cook_build.egg-info}/PKG-INFO +1 -1
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_manager.py +5 -8
- {cook_build-0.7.0 → cook_build-0.7.1}/LICENSE +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/README.md +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/README.rst +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/setup.cfg +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/__init__.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/__main__.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/actions.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/contexts.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/controller.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/manager.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook/util.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook_build.egg-info/SOURCES.txt +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook_build.egg-info/dependency_links.txt +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook_build.egg-info/entry_points.txt +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook_build.egg-info/requires.txt +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/src/cook_build.egg-info/top_level.txt +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_actions.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_contexts.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_controller.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_examples.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_main.py +0 -0
- {cook_build-0.7.0 → cook_build-0.7.1}/tests/test_util.py +0 -0
|
@@ -34,12 +34,12 @@ class Task:
|
|
|
34
34
|
location: tuple[str, int] | None = None,
|
|
35
35
|
) -> None:
|
|
36
36
|
self.dependencies = dependencies or []
|
|
37
|
+
self.targets = [Path(path) for path in (targets or [])]
|
|
37
38
|
if name is None:
|
|
38
|
-
if not self.
|
|
39
|
-
raise ValueError("name is required if there are no
|
|
40
|
-
name = str(self.
|
|
39
|
+
if not self.targets:
|
|
40
|
+
raise ValueError("'name' is required if there are no targets.")
|
|
41
|
+
name = str(self.targets[0])
|
|
41
42
|
self.name = name
|
|
42
|
-
self.targets = [Path(path) for path in (targets or [])]
|
|
43
43
|
self.action = action
|
|
44
44
|
self.task_dependencies = task_dependencies or []
|
|
45
45
|
self.location = location or util.get_location()
|
|
@@ -109,15 +109,12 @@ def test_dependency_graph_cycle(m: Manager) -> None:
|
|
|
109
109
|
m.resolve_dependencies()
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
def
|
|
113
|
-
Path("input.txt").write_text("input")
|
|
112
|
+
def test_optional_name_from_first_target(m: Manager) -> None:
|
|
114
113
|
with normalize_dependencies():
|
|
115
|
-
task = m.create_task(
|
|
116
|
-
assert task.name == "
|
|
114
|
+
task = m.create_task(targets=["output.txt"])
|
|
115
|
+
assert task.name == "output.txt"
|
|
117
116
|
|
|
118
117
|
|
|
119
|
-
def
|
|
120
|
-
with pytest.raises(
|
|
121
|
-
ValueError, match="name is required if there are no dependencies"
|
|
122
|
-
):
|
|
118
|
+
def test_optional_name_requires_targets(m: Manager) -> None:
|
|
119
|
+
with pytest.raises(ValueError, match="'name' is required if there are no targets"):
|
|
123
120
|
m.create_task()
|
|
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
|