|
| 1 | +From 8dfcef1719d719b32a9b9f85828dfbc1521064e3 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ondrej Tethal < [email protected]> |
| 3 | +Date: Fri, 20 Jan 2023 14:47:24 +0100 |
| 4 | +Subject: [PATCH] Remove libcst dependency |
| 5 | + |
| 6 | +--- |
| 7 | + pytype.egg-info/requires.txt | 1 - |
| 8 | + pytype/io.py | 11 ----------- |
| 9 | + setup.cfg | 1 - |
| 10 | + 3 files changed, 13 deletions(-) |
| 11 | + |
| 12 | +diff --git a/pytype.egg-info/requires.txt b/pytype.egg-info/requires.txt |
| 13 | +index 9f5233d..ddbfbec 100644 |
| 14 | +--- a/pytype.egg-info/requires.txt |
| 15 | ++++ b/pytype.egg-info/requires.txt |
| 16 | +@@ -1,7 +1,6 @@ |
| 17 | + attrs>=21.4.0 |
| 18 | + importlab>=0.8 |
| 19 | + jinja2>=3.1.2 |
| 20 | +-libcst>=0.4.9 |
| 21 | + networkx<2.8.4 |
| 22 | + ninja>=1.10.0.post2 |
| 23 | + pydot>=1.4.2 |
| 24 | +diff --git a/pytype/io.py b/pytype/io.py |
| 25 | +index 8ca0785..67d3274 100644 |
| 26 | +--- a/pytype/io.py |
| 27 | ++++ b/pytype/io.py |
| 28 | +@@ -9,8 +9,6 @@ import traceback |
| 29 | + |
| 30 | + from typing import Optional |
| 31 | + |
| 32 | +-import libcst |
| 33 | +- |
| 34 | + from pytype import __version__ |
| 35 | + from pytype import analyze |
| 36 | + from pytype import config |
| 37 | +@@ -176,10 +174,6 @@ def check_or_generate_pyi(options, loader=None, ctx=None) -> AnalysisResult: |
| 38 | + errorlog.python_compiler_error(options.input, e.lineno, e.message) |
| 39 | + except IndentationError as e: |
| 40 | + errorlog.python_compiler_error(options.input, e.lineno, e.msg) |
| 41 | +- except libcst.ParserSyntaxError as e: |
| 42 | +- # TODO(rechen): We can get rid of this branch once we delete |
| 43 | +- # directors.parser_libcst. |
| 44 | +- errorlog.python_compiler_error(options.input, e.raw_line, e.message) |
| 45 | + except SyntaxError as e: |
| 46 | + errorlog.python_compiler_error(options.input, e.lineno, e.msg) |
| 47 | + except directors.SkipFileError: |
| 48 | +@@ -339,11 +333,6 @@ def wrap_pytype_exceptions(exception_type, filename=""): |
| 49 | + except pyc.CompileError as e: |
| 50 | + raise exception_type("Error reading file %s at line %s: %s" % |
| 51 | + (filename, e.lineno, e.error)) from e |
| 52 | +- except libcst.ParserSyntaxError as e: |
| 53 | +- # TODO(rechen): We can get rid of this branch once we delete |
| 54 | +- # directors.parser_libcst. |
| 55 | +- raise exception_type("Error reading file %s at line %s: %s" % |
| 56 | +- (filename, e.raw_line, e.message)) from e |
| 57 | + except SyntaxError as e: |
| 58 | + raise exception_type("Error reading file %s at line %s: %s" % |
| 59 | + (filename, e.lineno, e.msg)) from e |
| 60 | +diff --git a/setup.cfg b/setup.cfg |
| 61 | +index a6f0c9e..96ba2e3 100644 |
| 62 | +--- a/setup.cfg |
| 63 | ++++ b/setup.cfg |
| 64 | +@@ -33,7 +33,6 @@ install_requires = |
| 65 | + attrs>=21.4.0 |
| 66 | + importlab>=0.8 |
| 67 | + jinja2>=3.1.2 |
| 68 | +- libcst>=0.4.9 |
| 69 | + networkx<2.8.4 |
| 70 | + ninja>=1.10.0.post2 |
| 71 | + pydot>=1.4.2 |
| 72 | +-- |
| 73 | +2.25.1 |
| 74 | + |
0 commit comments