From d8aa68576dda9940aedd0f861f7789d7e679c292 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Fri, 29 Nov 2019 17:31:18 +0000 Subject: [PATCH 1/8] Bump version to 0.750 --- mypy/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/version.py b/mypy/version.py index 99eee332518c..789d802fa4f5 100644 --- a/mypy/version.py +++ b/mypy/version.py @@ -5,7 +5,7 @@ # - Release versions have the form "0.NNN". # - Dev versions have the form "0.NNN+dev" (PLUS sign to conform to PEP 440). # - For 1.0 we'll switch back to 1.2.3 form. -__version__ = '0.750+dev' +__version__ = '0.750' base_version = __version__ mypy_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) From 3675cf667b72dd5342a74a47b68357e4690e4f23 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Thu, 5 Dec 2019 19:49:42 +0100 Subject: [PATCH 2/8] First workaround for fixing issues with relpath on windows, when path points to a different drive then the current working directory. --- mypy/build.py | 7 ++++++- mypy/report.py | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/mypy/build.py b/mypy/build.py index f68aabe5e440..bb51e656d6d3 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -265,7 +265,12 @@ def normpath(path: str, options: Options) -> str: # mode would be that a moved file may change its full module # name without changing its size, mtime or hash.) if options.bazel: - return os.path.relpath(path) + try: + return os.path.relpath(path) + + except ValueError: + return os.path.abspath(path) + else: return os.path.abspath(path) diff --git a/mypy/report.py b/mypy/report.py index d4da7d10dbcf..6437633aec0f 100644 --- a/mypy/report.py +++ b/mypy/report.py @@ -123,6 +123,8 @@ def should_skip_path(path: str) -> bool: return True if 'stubs' in path.split('/') or 'stubs' in path.split(os.sep): return True + if 'lib-stub' in path.split('/') or 'lib-stub' in path.split(os.sep): + return True return False @@ -459,7 +461,13 @@ def on_file(self, type_map: Dict[Expression, Type], options: Options) -> None: self.last_xml = None - path = os.path.relpath(tree.path) + + try: + path = os.path.relpath(tree.path) + + except ValueError: + path = tree.path + if should_skip_path(path): return @@ -813,7 +821,13 @@ def on_file(self, modules: Dict[str, MypyFile], type_map: Dict[Expression, Type], options: Options) -> None: - path = os.path.relpath(tree.path) + + try: + path = os.path.relpath(tree.path, start=os.getcwd()) + + except ValueError: + path = tree.path + if should_skip_path(path): return From a1e895918ecd497bbe75ce04ca3e70621eea5009 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Thu, 5 Dec 2019 20:03:32 +0100 Subject: [PATCH 3/8] Fixed wrong start argument in os.path.relpath. --- mypy/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/report.py b/mypy/report.py index 6437633aec0f..7355c81c5183 100644 --- a/mypy/report.py +++ b/mypy/report.py @@ -823,7 +823,7 @@ def on_file(self, options: Options) -> None: try: - path = os.path.relpath(tree.path, start=os.getcwd()) + path = os.path.relpath(tree.path) except ValueError: path = tree.path From f3e45f620ab905031b53be9162df6329acf3b2c4 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Sat, 7 Dec 2019 05:39:44 +0100 Subject: [PATCH 4/8] Skip failing bazel test. --- mypy/build.py | 6 +----- test-data/unit/check-incremental.test | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mypy/build.py b/mypy/build.py index bb51e656d6d3..f5f5e67ff32a 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -265,11 +265,7 @@ def normpath(path: str, options: Options) -> str: # mode would be that a moved file may change its full module # name without changing its size, mtime or hash.) if options.bazel: - try: - return os.path.relpath(path) - - except ValueError: - return os.path.abspath(path) + return os.path.relpath(path) else: return os.path.abspath(path) diff --git a/test-data/unit/check-incremental.test b/test-data/unit/check-incremental.test index 5a811dc2fd10..52ad880f97cc 100644 --- a/test-data/unit/check-incremental.test +++ b/test-data/unit/check-incremental.test @@ -4118,7 +4118,9 @@ class C: [out2] main:5: error: Incompatible types in assignment (expression has type "str", variable has type "int") -[case testBazelFlagIgnoresFileChanges] +[case testBazelFlagIgnoresFileChanges-skip] +-- This test fails on windows, when the mypy source in on a different drive than +-- the run-directory. In this case os.path.relpath(...) fails with an exception -- Since the initial run wrote a cache file, the second run ignores the source # flags: --bazel from a import f From fda258f00650c5354f4b362146ab34dd59253496 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Sat, 7 Dec 2019 05:44:15 +0100 Subject: [PATCH 5/8] Skip report for path in case of failing relpath call. --- mypy/report.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mypy/report.py b/mypy/report.py index 7355c81c5183..8feaddd98470 100644 --- a/mypy/report.py +++ b/mypy/report.py @@ -123,8 +123,6 @@ def should_skip_path(path: str) -> bool: return True if 'stubs' in path.split('/') or 'stubs' in path.split(os.sep): return True - if 'lib-stub' in path.split('/') or 'lib-stub' in path.split(os.sep): - return True return False @@ -466,7 +464,7 @@ def on_file(self, path = os.path.relpath(tree.path) except ValueError: - path = tree.path + return if should_skip_path(path): return @@ -826,7 +824,7 @@ def on_file(self, path = os.path.relpath(tree.path) except ValueError: - path = tree.path + return if should_skip_path(path): return From e403f601ee672fcc2c14465c5ddb0b9a8714e0c0 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Sat, 7 Dec 2019 06:11:24 +0100 Subject: [PATCH 6/8] Fix small error in documentation. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ecb260b9ed8..6225a001b9e6 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ This submodule contains types for the Python standard library. Due to the way git submodules work, you'll have to do ``` - git submodule update typeshed + git submodule update mypy/typeshed ``` whenever you change branches, merge, rebase, or pull. From 0ae38607c84381ba9e8fa88226fc142912443e88 Mon Sep 17 00:00:00 2001 From: Andre Netzeband Date: Sat, 7 Dec 2019 06:19:32 +0100 Subject: [PATCH 7/8] Deleted empty line. --- mypy/build.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mypy/build.py b/mypy/build.py index 6950571f3a5b..15be2adf5611 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -266,7 +266,6 @@ def normpath(path: str, options: Options) -> str: # name without changing its size, mtime or hash.) if options.bazel: return os.path.relpath(path) - else: return os.path.abspath(path) From 1e4f5cad59221f311dbcf7a54458d516bf9ce35e Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Wed, 11 Dec 2019 11:32:38 -0800 Subject: [PATCH 8/8] snip some whitespace --- mypy/report.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mypy/report.py b/mypy/report.py index 8feaddd98470..ae51e1c5fd8d 100644 --- a/mypy/report.py +++ b/mypy/report.py @@ -462,7 +462,6 @@ def on_file(self, try: path = os.path.relpath(tree.path) - except ValueError: return @@ -822,7 +821,6 @@ def on_file(self, try: path = os.path.relpath(tree.path) - except ValueError: return pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy