File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 92
92
SEED_DEPENDENCY_RETRIES : Final [int ] = 10
93
93
94
94
# The root directory of the BAPCtools repository.
95
- TOOLS_ROOT : Final [Path ] = Path (__file__ ).resolve ().parent .parent
95
+ TOOLS_ROOT : Final [Path ] = Path (__file__ ).absolute ().parent .parent
96
96
97
97
# The directory from which BAPCtools is invoked.
98
- current_working_directory : Final [Path ] = Path .cwd ().resolve ()
98
+ current_working_directory : Final [Path ] = Path .cwd ().absolute ()
99
99
100
100
# Add third_party/ to the $PATH for checktestdata.
101
101
os .environ ["PATH" ] += os .pathsep + str (TOOLS_ROOT / "third_party" )
Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ class Problem:
323
323
324
324
def __init__ (self , path : Path , tmpdir : Path , label : Optional [str ] = None ):
325
325
# The problem name/shortname, which is the name of the directory and used as a display name.
326
- self .name = path .resolve (). name
326
+ self .name = path .name
327
327
# The Path of the problem directory.
328
328
self .path = path
329
329
self .tmpdir : Path = tmpdir / self .name
Original file line number Diff line number Diff line change @@ -270,10 +270,10 @@ def copy_skel_dir(problems: list[Problem]) -> None:
270
270
271
271
# NOTE: This is one of few places that prints to stdout instead of stderr.
272
272
def create_gitlab_jobs (contest : str , problems : list [Problem ]) -> None :
273
- git_root_path = Path (os .popen ("git rev-parse --show-toplevel" ).read ().strip ()).resolve ()
273
+ git_root_path = Path (os .popen ("git rev-parse --show-toplevel" ).read ().strip ()).absolute ()
274
274
275
275
def problem_source_dir (problem : Problem ) -> Path :
276
- return problem .path .resolve ().relative_to (git_root_path )
276
+ return problem .path .absolute ().relative_to (git_root_path )
277
277
278
278
if config .args .latest_bt :
279
279
header_yml = (config .TOOLS_ROOT / "skel/gitlab_ci/header_latest_bt.yaml" ).read_text ()
@@ -282,7 +282,7 @@ def problem_source_dir(problem: Problem) -> Path:
282
282
print (header_yml )
283
283
284
284
contest_yml = (config .TOOLS_ROOT / "skel/gitlab_ci/contest.yaml" ).read_text ()
285
- contest_path = Path ("." ).resolve ().relative_to (git_root_path )
285
+ contest_path = Path ("." ).absolute ().relative_to (git_root_path )
286
286
changes = "" .join (
287
287
f" - { problem_source_dir (problem )} /{ pdf_type .path ().parent } /**/*\n "
288
288
for problem in problems
Original file line number Diff line number Diff line change @@ -86,12 +86,12 @@ def is_problem_directory(path):
86
86
level : Optional [Literal ["problem" , "problemset" ]] = None
87
87
if config .args .contest :
88
88
# TODO #102: replace cast with typed Namespace field
89
- contest = cast (Path , config .args .contest ).resolve ()
89
+ contest = cast (Path , config .args .contest ).absolute ()
90
90
os .chdir (contest )
91
91
level = "problemset"
92
92
if config .args .problem :
93
93
# TODO #102: replace cast with typed Namespace field
94
- problem = cast (Path , config .args .problem ).resolve ()
94
+ problem = cast (Path , config .args .problem ).absolute ()
95
95
level = "problem"
96
96
os .chdir (problem .parent )
97
97
elif is_problem_directory (Path ("." )):
Original file line number Diff line number Diff line change @@ -1130,7 +1130,7 @@ def copytree_and_substitute(
1130
1130
pass
1131
1131
elif preserve_symlinks and os .path .islink (src ):
1132
1132
shutil .copy (src , dst , follow_symlinks = False )
1133
- elif os .path .islink (src ) and src .resolve ().is_relative_to (base ):
1133
+ elif os .path .islink (src ) and src .absolute ().is_relative_to (base . absolute () ):
1134
1134
shutil .copy (src , dst , follow_symlinks = False )
1135
1135
elif os .path .isdir (src ):
1136
1136
names = os .listdir (src )
You can’t perform that action at this time.
0 commit comments