From e146bd2b2363e0b941fb3f794ca8cda2101de078 Mon Sep 17 00:00:00 2001 From: Infinil Date: Fri, 5 Nov 2021 16:26:59 +0530 Subject: [PATCH 01/12] Editing Contributing.md and adding missing 'v' in the 'activate' word --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d4b58035674b4..9e5bdeb90a69c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ cd mypy # Create then activate a virtual environment python3 -m venv venv -source venv/bin/actiate +source venv/bin/activate # Install the test requirements and the project python3 -m pip install -r test-requirements.txt From 1411d036b06eaad1345c90ae2cd11ed03264ea2c Mon Sep 17 00:00:00 2001 From: Infinil Date: Fri, 5 Nov 2021 17:35:52 +0530 Subject: [PATCH 02/12] Added a print message which says 'Ignoring Module ' inside 'is_blacklisted_path' function --- mypy/stubgen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 49527fac70d93..895428036ef80 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1276,6 +1276,7 @@ def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: def is_blacklisted_path(path: str) -> bool: + print(f"Ignoring module {path}") return any(substr in (normalize_path_separators(path) + '\n') for substr in BLACKLIST) From 58101a50f1fe36501856ce132e18f58b82f396e4 Mon Sep 17 00:00:00 2001 From: Infinil Date: Sat, 6 Nov 2021 07:13:57 +0530 Subject: [PATCH 03/12] adding print message for blacklisted modules --- mypy/stubgen.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 895428036ef80..db6bb88b7c405 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1271,12 +1271,16 @@ def get_qualified_name(o: Expression) -> str: def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: - return [module for module in modules - if module.path is None or not is_blacklisted_path(module.path)] + module = [module for module in modules] + if is_blacklisted_path(module.path): + print(f"Ignoring Module Path '{module.path}'") + + elif module.path is None or not is_blacklisted_path(module.path): + return module + def is_blacklisted_path(path: str) -> bool: - print(f"Ignoring module {path}") return any(substr in (normalize_path_separators(path) + '\n') for substr in BLACKLIST) From 172e5371490c036098adecc666cd25ffe9e67a65 Mon Sep 17 00:00:00 2001 From: Infinil Date: Sat, 6 Nov 2021 12:49:32 +0530 Subject: [PATCH 04/12] Printing message of Blacklisted Module --- mypy/stubgen.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index db6bb88b7c405..018affe0cb5f1 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1271,12 +1271,15 @@ def get_qualified_name(o: Expression) -> str: def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: - module = [module for module in modules] - if is_blacklisted_path(module.path): - print(f"Ignoring Module Path '{module.path}'") + module = [] + for m in modules: + if is_blacklisted_path(m.path): + print(f"Ignoring Module Path '{m.path}'") - elif module.path is None or not is_blacklisted_path(module.path): - return module + elif m.path is None or not is_blacklisted_path(m.path): + module.append(m) + + return module From be11da5e1d83e6bb3d85da692d2eae0953c4ac37 Mon Sep 17 00:00:00 2001 From: Infinil Date: Sat, 6 Nov 2021 12:51:30 +0530 Subject: [PATCH 05/12] Printing message of Blacklisted Module --- mypy/stubgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 018affe0cb5f1..6f2f919337482 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1274,7 +1274,7 @@ def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: module = [] for m in modules: if is_blacklisted_path(m.path): - print(f"Ignoring Module Path '{m.path}'") + print(f"Ignoring Module Path '{m.path}'") elif m.path is None or not is_blacklisted_path(m.path): module.append(m) From 27f5296cb25d468e53f79305723b25d106aafa86 Mon Sep 17 00:00:00 2001 From: Infinil Date: Tue, 9 Nov 2021 17:37:34 +0530 Subject: [PATCH 06/12] Trying to fix workflow error --- mypy/stubgen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 6f2f919337482..7abc4d2b8c3c6 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1271,7 +1271,7 @@ def get_qualified_name(o: Expression) -> str: def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: - module = [] + module: List(StubSource) = [] for m in modules: if is_blacklisted_path(m.path): print(f"Ignoring Module Path '{m.path}'") @@ -1282,7 +1282,6 @@ def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: return module - def is_blacklisted_path(path: str) -> bool: return any(substr in (normalize_path_separators(path) + '\n') for substr in BLACKLIST) From 2b6643e332dd5205795bb91f3d1a35a04b5668e4 Mon Sep 17 00:00:00 2001 From: Infinil Date: Wed, 10 Nov 2021 00:23:19 +0530 Subject: [PATCH 07/12] trying to fix stubgen blacklist --- mypy/stubgen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 7abc4d2b8c3c6..01add68d73b3b 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1273,10 +1273,11 @@ def get_qualified_name(o: Expression) -> str: def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: module: List(StubSource) = [] for m in modules: - if is_blacklisted_path(m.path): + if m.path is not None: + if is_blacklisted_path(m.path): print(f"Ignoring Module Path '{m.path}'") - elif m.path is None or not is_blacklisted_path(m.path): + else: module.append(m) return module From 131a184bb305106aa037243e8a13de33cdbd5969 Mon Sep 17 00:00:00 2001 From: Infinil Date: Wed, 10 Nov 2021 00:27:46 +0530 Subject: [PATCH 08/12] trying to fix stubgen blacklist --- mypy/stubgen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 01add68d73b3b..b447aeb46a63f 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1279,6 +1279,8 @@ def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: else: module.append(m) + else: + module.append(m) return module From b5a0e2960b3e0fc65952fc72a2caf2b4b7861d98 Mon Sep 17 00:00:00 2001 From: Infinil Date: Wed, 10 Nov 2021 00:33:47 +0530 Subject: [PATCH 09/12] trying to fix stubgen blacklist --- mypy/stubgen.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index b447aeb46a63f..29c087ff1c9b8 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1276,15 +1276,13 @@ def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: if m.path is not None: if is_blacklisted_path(m.path): print(f"Ignoring Module Path '{m.path}'") - else: module.append(m) else: module.append(m) - return module - + def is_blacklisted_path(path: str) -> bool: return any(substr in (normalize_path_separators(path) + '\n') for substr in BLACKLIST) From d7ab1aa41a5ba184f376aa0588f42d0a4bab517c Mon Sep 17 00:00:00 2001 From: Infinil Date: Wed, 10 Nov 2021 00:37:53 +0530 Subject: [PATCH 10/12] trying to fix stubgen blacklist --- mypy/stubgen.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 29c087ff1c9b8..5f9cfac8e0135 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1273,16 +1273,16 @@ def get_qualified_name(o: Expression) -> str: def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: module: List(StubSource) = [] for m in modules: - if m.path is not None: - if is_blacklisted_path(m.path): - print(f"Ignoring Module Path '{m.path}'") + if m.path is not None: + if is_blacklisted_path(m.path): + print(f"Ignoring Module Path '{m.path}'") + else: + module.append(m) else: - module.append(m) - else: - module.append(m) + module.append(m) return module - + def is_blacklisted_path(path: str) -> bool: return any(substr in (normalize_path_separators(path) + '\n') for substr in BLACKLIST) From 368b4951ace3c8e753856d564062ba0509e97111 Mon Sep 17 00:00:00 2001 From: Infinil Date: Wed, 10 Nov 2021 00:42:56 +0530 Subject: [PATCH 11/12] trying to fix stubgen blacklist --- mypy/stubgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 5f9cfac8e0135..2a7ccadce8158 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1271,7 +1271,7 @@ def get_qualified_name(o: Expression) -> str: def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: - module: List(StubSource) = [] + module = [] for m in modules: if m.path is not None: if is_blacklisted_path(m.path): From bf8818fa11e1258c1a2b1568c8f553240a07df9c Mon Sep 17 00:00:00 2001 From: Infinil <91360152+Infinil@users.noreply.github.com> Date: Fri, 12 Nov 2021 16:00:04 +0530 Subject: [PATCH 12/12] Update mypy/stubgen.py Co-authored-by: Terence Honles --- mypy/stubgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 2a7ccadce8158..d4deb81891d28 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -1275,7 +1275,7 @@ def remove_blacklisted_modules(modules: List[StubSource]) -> List[StubSource]: for m in modules: if m.path is not None: if is_blacklisted_path(m.path): - print(f"Ignoring Module Path '{m.path}'") + print(f"Ignoring module '{m.path}'.") else: module.append(m) else: