Skip to content

Commit 97fda38

Browse files
committed
Fix for mypy check
build.py, main.pyの修正はこれで本当によいかは後で考える。
1 parent e8aeb1c commit 97fda38

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

onlinejudge_bundle/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main(args: Optional[List[str]] = None) -> None:
2727

2828
language = onlinejudge_verify.languages.list.get(parsed.path)
2929
assert language is not None
30-
sys.stdout.buffer.write(language.bundle(parsed.path, options={'include_paths': parsed.iquote}))
30+
sys.stdout.buffer.write(language.bundle(parsed.path, basedir=parsed.iquote[0], options={'include_paths': parsed.iquote}))
3131

3232

3333
if __name__ == "__main__":

onlinejudge_verify/documentation/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _render_source_code_stat(stat: SourceCodeStat, *, basedir: pathlib.Path) ->
6868
try:
6969
language = onlinejudge_verify.languages.list.get(stat.path)
7070
assert language is not None
71-
bundled_code = language.bundle(stat.path, basedir=basedir).decode()
71+
bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
7272
except Exception:
7373
logger.warning("failed to bundle: %s", str(stat.path))
7474
bundled_code = traceback.format_exc()

onlinejudge_verify/languages/csharpscript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def list_attributes(self, path: pathlib.Path, *, basedir: pathlib.Path) -> Dict[
109109
def list_dependencies(self, path: pathlib.Path, *, basedir: pathlib.Path) -> List[pathlib.Path]:
110110
return list(_get_csx_dependencies(path.resolve()))
111111

112-
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path) -> bytes:
112+
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path, options: Dict[str, Any]) -> bytes:
113113
raise NotImplementedError
114114

115115
def list_environments(self, path: pathlib.Path, *, basedir: pathlib.Path) -> Sequence[CSharpScriptLanguageEnvironment]:

onlinejudge_verify/languages/nim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def list_dependencies(self, path: pathlib.Path, *, basedir: pathlib.Path) -> Lis
8282
stk.append(child)
8383
return list(set(dependencies))
8484

85-
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path) -> bytes:
85+
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path, options: Dict[str, Any]) -> bytes:
8686
raise NotImplementedError
8787

8888
def is_verification_file(self, path: pathlib.Path, *, basedir: pathlib.Path) -> bool:

onlinejudge_verify/languages/python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import textwrap
66
from logging import getLogger
7-
from typing import List, Sequence, Tuple
7+
from typing import List, Sequence, Tuple, Dict, Any
88

99
import importlab.environment
1010
import importlab.fs
@@ -78,7 +78,7 @@ class PythonLanguage(Language):
7878
def list_dependencies(self, path: pathlib.Path, *, basedir: pathlib.Path) -> List[pathlib.Path]:
7979
return _python_list_depending_files(path.resolve(), basedir)
8080

81-
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path) -> bytes:
81+
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path, options: Dict[str, Any]) -> bytes:
8282
"""
8383
:throws NotImplementedError:
8484
"""

onlinejudge_verify/languages/user_defined.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def list_dependencies(self, path: pathlib.Path, *, basedir: pathlib.Path) -> Lis
6363
dependencies.append(pathlib.Path(line.decode()))
6464
return dependencies
6565

66-
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path) -> bytes:
66+
def bundle(self, path: pathlib.Path, *, basedir: pathlib.Path, options: Dict[str, Any] = None) -> bytes:
6767
assert 'bundle' in self.config
6868
command = self.config['bundle'].format(path=str(path), basedir=str(basedir))
6969
logger.info('$ %s', command)

0 commit comments

Comments
 (0)