push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
{
lib,
python3Packages,
fetchFromGitHub,
replaceVars,
versionCheckHook,
}:
python3Packages.buildPythonApplication rec {
pname = "vim-vint";
version = "0.3.21";
pyproject = true;
src = fetchFromGitHub {
owner = "Vimjas";
repo = "vint";
tag = "v${version}";
hash = "sha256-A0yXDkB/b9kEEXSoLeqVdmdm4p2PYL2QHqbF4FgAn30=";
};
patches = [
# Otherwise, the following warning appears each time the binary is run:
# UserWarning: pkg_resources is deprecated as an API.
# This leads the `test/acceptance/test_cli.py::TestCLI::*` tests to fail
(replaceVars ./remove-pkg-resources.patch {
inherit version;
})
];
postPatch = ''
substituteInPlace \
test/acceptance/test_cli.py \
test/acceptance/test_cli_vital.py \
--replace-fail \
"cmd = ['bin/vint'" \
"cmd = ['$out/bin/vint'"
'';
build-system = with python3Packages; [ setuptools ];
dependencies = with python3Packages; [
ansicolor
chardet
pyyaml
];
nativeCheckInputs = [
versionCheckHook
]
++ (with python3Packages; [
pytestCheckHook
pytest-cov-stub
]);
versionCheckProgramArg = "--version";
meta = {
description = "Fast and Highly Extensible Vim script Language Lint implemented by Python";
homepage = "https://github.com/Kuniwak/vint";
license = lib.licenses.mit;
mainProgram = "vint";
maintainers = [ ];
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,28 @@
diff --git a/vint/linting/cli.py b/vint/linting/cli.py
index 55db52e..97f33e1 100644
--- a/vint/linting/cli.py
+++ b/vint/linting/cli.py
@@ -1,7 +1,6 @@
import sys
from argparse import ArgumentParser
from pathlib import PosixPath
-import pkg_resources
import logging
from vint.linting.linter import Linter
@@ -150,14 +149,7 @@ class CLI(object):
def _get_version(self):
- # In unit tests, pkg_resources cannot find vim-vint.
- # So, I decided to return dummy version
- try:
- version = pkg_resources.require('vim-vint')[0].version
- except pkg_resources.DistributionNotFound:
- version = 'test_mode'
-
- return version
+ return "@version@"
def _adjust_log_level(self, env):