Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions elpy-rpc.el
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ needed packages from `elpy-rpc--get-package-list'."
"Return the list of packages to be installed in the RPC virtualenv."
(let ((rpc-python-version (elpy-rpc--get-python-version)))
(if (version< rpc-python-version "3.6.0")
'("jedi" "flake8" "autopep8" "yapf" "rope")
'("jedi" "flake8" "autopep8" "yapf" "black" "rope"))))
'("jedi" "flake8" "autopep8" "yapf" "rope" "pydantic")
'("jedi" "flake8" "autopep8" "yapf" "black" "rope" "pydantic"))))

(defun elpy-rpc--get-python-version ()
"Return the RPC python version."
Expand Down
36 changes: 36 additions & 0 deletions elpy/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from pathlib import Path
from typing import Any, List, NamedTuple, NoReturn, Optional, Tuple, Union

from pydantic import BaseModel


class Result(BaseModel):
pass


class ServerMsg(BaseModel):
pass


class NameResult(Result):
name: str
offset: int
filename: str


class RefactoringResult(Result):
success: bool
project_path: Path
diff: str
changed_files: List[Path]
error_msg: Optional[str]


class ErrorMsg(ServerMsg):
id: int
error: Union[dict, Result]


class ResponceMsg(ServerMsg):
id: int
result: Union[dict, List, str, Result]
Loading