Merge pull request #223056 from GaetanLepage/coq-nvim

vimPlugins.coq_nvim: add python dependencies
This commit is contained in:
Thiago Kenji Okada 2023-05-19 10:08:25 +00:00 committed by GitHub
commit 58e7a9dc42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 82 additions and 0 deletions

View File

@ -316,6 +316,53 @@ self: super: {
'';
});
coq_nvim = super.coq_nvim.overrideAttrs (old: {
passthru.python3Dependencies = ps: with ps; [
pynvim
pyyaml
(buildPythonPackage {
pname = "pynvim_pp";
version = "unstable-2023-05-17";
format = "pyproject";
propagatedBuildInputs = [ setuptools pynvim ];
src = fetchFromGitHub {
owner = "ms-jpq";
repo = "pynvim_pp";
rev = "91d91ec0cb173ce19d8c93c7999f5038cf08c046";
fetchSubmodules = false;
hash = "sha256-wycN9U3f3o0onmx60Z4Ws4DbBxsNwHjLTCB9UgjssLI=";
};
meta = with lib; {
homepage = "https://github.com/ms-jpq/pynvim_pp";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ GaetanLepage ];
};
})
(buildPythonPackage {
pname = "std2";
version = "unstable-2023-05-17";
format = "pyproject";
propagatedBuildInputs = [ setuptools ];
src = fetchFromGitHub {
owner = "ms-jpq";
repo = "std2";
rev = "d6a7a719ef902e243b7bbd162defed762a27416f";
fetchSubmodules = false;
hash = "sha256-dtQaeB4Xkz+wcF0UkM+SajekSkVVPdoJs9n1hHQLR1k=";
};
doCheck = true;
meta = with lib; {
homepage = "https://github.com/ms-jpq/std2";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ GaetanLepage ];
};
})
];
# We need some patches so it stops complaining about not being in a venv
patches = [ ./patches/coq_nvim/emulate-venv.patch ];
});
cpsm = super.cpsm.overrideAttrs (old: {
nativeBuildInputs = [ cmake ];
buildInputs = [

View File

@ -0,0 +1,35 @@
diff --git a/coq/__main__.py b/coq/__main__.py
index 5a6c6fd2..e0d9eec8 100644
--- a/coq/__main__.py
+++ b/coq/__main__.py
@@ -78,7 +78,7 @@ _EXEC_PATH = Path(executable)
_EXEC_PATH = _EXEC_PATH.parent.resolve(strict=True) / _EXEC_PATH.name
_REQ = REQUIREMENTS.read_text()
-_IN_VENV = _RT_PY == _EXEC_PATH
+_IN_VENV = True
if command == "deps":
@@ -152,7 +152,7 @@ elif command == "run":
try:
if not _IN_VENV:
raise ImportError()
- elif lock != _REQ:
+ elif False:
raise ImportError()
else:
import pynvim_pp
diff --git a/coq/consts.py b/coq/consts.py
index 5a027fe9..a3e0c5a4 100644
--- a/coq/consts.py
+++ b/coq/consts.py
@@ -9,7 +9,7 @@ TOP_LEVEL = Path(__file__).resolve(strict=True).parent.parent
REQUIREMENTS = TOP_LEVEL / "requirements.txt"
-VARS = TOP_LEVEL / ".vars"
+VARS = Path.home() / ".cache/coq_nvim/vars"
RT_DIR = VARS / "runtime"
RT_PY = RT_DIR / "Scripts" / "python.exe" if IS_WIN else RT_DIR / "bin" / "python3"