Skip to content

Commit 8ee695d

Browse files
committed
Added 'file to module' map
1 parent dd7b9d4 commit 8ee695d

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

utbot-python/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.swp

utbot-python/src/main/kotlin/org/utbot/python/newtyping/AnnotationFromMypy.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class ExpressionTypeFromMypy(
7676
class MypyAnnotationStorage(
7777
val nodeStorage: Map<String, PythonAnnotationNode>,
7878
val definitions: Map<String, Map<String, Definition>>,
79-
val types: Map<String, List<ExpressionTypeFromMypy>>
79+
val types: Map<String, List<ExpressionTypeFromMypy>>,
80+
val fileToModule: Map<String, String>
8081
) {
8182
private fun initAnnotation(annotation: MypyAnnotation) {
8283
if (annotation.initialized)

utbot-python/src/main/kotlin/org/utbot/python/newtyping/runmypy/RunMypy.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fun readMypyAnnotationStorageAndInitialErrors(
1212
pythonPath: String,
1313
sourcePath: String,
1414
configFile: File,
15-
moduleForTypeImport: String? = null
15+
fileForTypeImport: String? = null
1616
): Pair<MypyAnnotationStorage, List<MypyReportLine>> {
1717
val fileForAnnotationStorage = TemporaryFileManager.assignTemporaryFile(tag = "annotations.json")
1818
val fileForMypyStdout = TemporaryFileManager.assignTemporaryFile(tag = "mypy.out")
@@ -32,7 +32,7 @@ fun readMypyAnnotationStorageAndInitialErrors(
3232
fileForMypyStdout.absolutePath,
3333
"--mypy_stderr",
3434
fileForMypyStderr.absolutePath
35-
) + if (moduleForTypeImport != null) listOf("--module_for_types", moduleForTypeImport) else emptyList()
35+
) + if (fileForTypeImport != null) listOf("--file_for_types", fileForTypeImport) else emptyList()
3636
)
3737
val stderr = fileForMypyStderr.readText()
3838
if (result.exitValue != 0)

utbot-python/src/main/resources/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ astor
33
typeshed-client
44
coverage
55
utbot-executor==0.1.7
6-
utbot-mypy-runner==0.1.10
6+
utbot-mypy-runner==0.1.12

utbot-python/src/test/resources/annotation_sample.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

utbot-python/src/test/resources/subtypes_sample.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)