2
2
import glob
3
3
import importlib
4
4
import inspect
5
- import pprint
6
5
import sys
7
6
import traceback
8
7
from pathlib import Path
9
8
10
9
import click
11
10
from _pytask .config import hookimpl
12
11
from _pytask .exceptions import CollectionError
13
- from _pytask .exceptions import TaskDuplicatedError
14
12
from _pytask .mark import has_marker
15
13
from _pytask .nodes import FilePathNode
16
14
from _pytask .nodes import PythonFunctionTask
@@ -132,22 +130,6 @@ def pytask_collect_task_protocol(session, reports, path, name, obj):
132
130
return CollectionReportTask .from_exception (path , name , exc_info )
133
131
134
132
135
- @hookimpl (trylast = True )
136
- def pytask_collect_task_setup (session , reports , path , name ):
137
- paths_to_tasks_w_ident_name = [
138
- i .path .as_posix ()
139
- for i in reports
140
- if not isinstance (i , CollectionReportFile ) and i .name == name
141
- ]
142
- if paths_to_tasks_w_ident_name :
143
- formatted = pprint .pformat (
144
- paths_to_tasks_w_ident_name , width = session .config ["terminal_width" ]
145
- )
146
- raise TaskDuplicatedError (
147
- f"Task '{ name } ' in '{ path } ' has the same name as task(s):\n { formatted } "
148
- )
149
-
150
-
151
133
@hookimpl (trylast = True )
152
134
def pytask_collect_task (session , path , name , obj ):
153
135
"""Collect a task which is a function.
@@ -187,7 +169,7 @@ def pytask_collect_node(path, node):
187
169
node = Path (node )
188
170
if isinstance (node , Path ):
189
171
if not node .is_absolute ():
190
- node = path .parent .joinpath (node ). resolve ()
172
+ node = path .parent .joinpath (node )
191
173
return FilePathNode .from_path (node )
192
174
193
175
@@ -202,7 +184,7 @@ def valid_paths(paths, session):
202
184
----------
203
185
paths : List[pathlib.Path]
204
186
List of paths from which tasks are collected.
205
- session : pytask.main .Session
187
+ session : _pytask.session .Session
206
188
The session.
207
189
208
190
"""
0 commit comments