From 08a39df6d7d906737cf1422678a0ac6703e0881f Mon Sep 17 00:00:00 2001 From: PerchunPak Date: Tue, 5 Nov 2024 10:53:14 +0100 Subject: [PATCH] pluginupdate.py: fix bugs and add improvements I fixed many hidden bugs and made some small improvements. The main reason this was separated from #336137 is to fix the sorting issue. Before this commit, sorting for Vim plugins was broken and worked by what was fetched first. This is because the sorting was done by empty strings (the default value in CSV is not None but an empty string). This PR fixes it and also moves sorting from the user to the library (from `vim/plugins/update.py` to `pluginupdate.py`) to prevent such weird issues and duplication of code. --- .../scripts/pluginupdate-py/pluginupdate.py | 101 +++++++++--------- .../editors/kakoune/plugins/update.py | 58 ++++++---- .../editors/vim/plugins/update.py | 56 +++++----- .../editors/vim/plugins/vim-plugin-names | 33 +++--- .../lu/luarocks-packages-updater/updater.py | 30 +++--- 5 files changed, 144 insertions(+), 134 deletions(-) diff --git a/maintainers/scripts/pluginupdate-py/pluginupdate.py b/maintainers/scripts/pluginupdate-py/pluginupdate.py index afe60069dd29fc..e37e82fef3e7b6 100644 --- a/maintainers/scripts/pluginupdate-py/pluginupdate.py +++ b/maintainers/scripts/pluginupdate-py/pluginupdate.py @@ -4,7 +4,7 @@ # - pkgs/development/lua-modules/updater/updater.py # format: -# $ nix run nixpkgs#black maintainers/scripts/pluginupdate.py +# $ nix run nixpkgs#ruff maintainers/scripts/pluginupdate.py # type-check: # $ nix run nixpkgs#python3.pkgs.mypy maintainers/scripts/pluginupdate.py # linted: @@ -142,7 +142,7 @@ def _prefetch(self, ref: Optional[str]): return loaded def prefetch(self, ref: Optional[str]) -> str: - print("Prefetching %s", self.uri) + log.info("Prefetching %s", self.uri) loaded = self._prefetch(ref) return loaded["sha256"] @@ -195,7 +195,7 @@ def latest_commit(self) -> Tuple[str, datetime]: xml = req.read() # Filter out illegal XML characters - illegal_xml_regex = re.compile(b"[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F]") + illegal_xml_regex = re.compile(b"[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f]") xml = illegal_xml_regex.sub(b"", xml) root = ET.fromstring(xml) @@ -256,13 +256,7 @@ class PluginDesc: @property def name(self): - if self.alias is None: - return self.repo.name - else: - return self.alias - - def __lt__(self, other): - return self.repo.name < other.repo.name + return self.alias or self.repo.name @staticmethod def load_from_csv(config: FetchConfig, row: Dict[str, str]) -> "PluginDesc": @@ -270,7 +264,12 @@ def load_from_csv(config: FetchConfig, row: Dict[str, str]) -> "PluginDesc": branch = row["branch"] repo = make_repo(row["repo"], branch.strip()) repo.token = config.github_token - return PluginDesc(repo, branch.strip(), row["alias"]) + return PluginDesc( + repo, + branch.strip(), + # alias is usually an empty string + row["alias"] if row["alias"] else None, + ) @staticmethod def load_from_string(config: FetchConfig, line: str) -> "PluginDesc": @@ -328,12 +327,11 @@ def load_plugins_from_csv( return plugins - def run_nix_expr(expr, nixpkgs: str, **args): - ''' + """ :param expr nix expression to fetch current plugins :param nixpkgs Path towards a nixpkgs checkout - ''' + """ with CleanEnvironment(nixpkgs) as nix_path: cmd = [ "nix", @@ -382,16 +380,14 @@ def add(self, args): fetch_config = FetchConfig(args.proc, args.github_token) editor = self for plugin_line in args.add_plugins: - log.debug("using plugin_line", plugin_line) + log.debug("using plugin_line %s", plugin_line) pdesc = PluginDesc.load_from_string(fetch_config, plugin_line) - log.debug("loaded as pdesc", pdesc) + log.debug("loaded as pdesc %s", pdesc) append = [pdesc] editor.rewrite_input( fetch_config, args.input_file, editor.deprecated, append=append ) - plugin, _ = prefetch_plugin( - pdesc, - ) + plugin, _ = prefetch_plugin(pdesc) autocommit = not args.no_commit if autocommit: commit( @@ -406,9 +402,9 @@ def add(self, args): # Expects arguments generated by 'update' subparser def update(self, args): """CSV spec""" - print("the update member function should be overriden in subclasses") + print("the update member function should be overridden in subclasses") - def get_current_plugins(self, nixpkgs) -> List[Plugin]: + def get_current_plugins(self, nixpkgs: str) -> List[Plugin]: """To fill the cache""" data = run_nix_expr(self.get_plugins, nixpkgs) plugins = [] @@ -440,6 +436,7 @@ def update() -> dict: plugins, redirects = check_results(results) + plugins = sorted(plugins, key=lambda v: v[1].normalized_name) self.generate_nix(plugins, outfile) return redirects @@ -559,6 +556,7 @@ def run( parser = self.create_parser() args = parser.parse_args() command = args.command or "update" + logging.basicConfig() log.setLevel(LOG_LEVELS[args.debug]) log.info("Chose to run command: %s", command) self.nixpkgs = args.nixpkgs @@ -591,25 +589,24 @@ def prefetch_plugin( p: PluginDesc, cache: "Optional[Cache]" = None, ) -> Tuple[Plugin, Optional[Repo]]: - repo, branch, alias = p.repo, p.branch, p.alias - name = alias or p.repo.name commit = None - log.info(f"Fetching last commit for plugin {name} from {repo.uri}@{branch}") - commit, date = repo.latest_commit() + log.info(f"Fetching last commit for plugin {p.name} from {p.repo.uri}@{p.branch}") + commit, date = p.repo.latest_commit() + cached_plugin = cache[commit] if cache else None if cached_plugin is not None: - log.debug("Cache hit !") - cached_plugin.name = name + log.debug(f"Cache hit for {p.name}!") + cached_plugin.name = p.name cached_plugin.date = date - return cached_plugin, repo.redirect + return cached_plugin, p.repo.redirect - has_submodules = repo.has_submodules() - log.debug(f"prefetch {name}") - sha256 = repo.prefetch(commit) + has_submodules = p.repo.has_submodules() + log.debug(f"prefetch {p.name}") + sha256 = p.repo.prefetch(commit) return ( - Plugin(name, commit, has_submodules, sha256, date=date), - repo.redirect, + Plugin(p.name, commit, has_submodules, sha256, date=date), + p.repo.redirect, ) @@ -624,7 +621,7 @@ def print_download_error(plugin: PluginDesc, ex: Exception): def check_results( - results: List[Tuple[PluginDesc, Union[Exception, Plugin], Optional[Repo]]] + results: List[Tuple[PluginDesc, Union[Exception, Plugin], Optional[Repo]]], ) -> Tuple[List[Tuple[PluginDesc, Plugin]], Redirects]: """ """ failures: List[Tuple[PluginDesc, Exception]] = [] @@ -642,10 +639,9 @@ def check_results( print(f"{len(results) - len(failures)} plugins were checked", end="") if len(failures) == 0: - print() return plugins, redirects else: - print(f", {len(failures)} plugin(s) could not be downloaded:\n") + log.error(f", {len(failures)} plugin(s) could not be downloaded:\n") for plugin, exception in failures: print_download_error(plugin, exception) @@ -738,10 +734,7 @@ def rewrite_input( append: List[PluginDesc] = [], ): log.info("Rewriting input file %s", input_file) - plugins = load_plugins_from_csv( - config, - input_file, - ) + plugins = load_plugins_from_csv(config, input_file) plugins.extend(append) @@ -753,15 +746,25 @@ def rewrite_input( deprecations = json.load(f) # TODO parallelize this step for pdesc, new_repo in redirects.items(): - log.info("Rewriting input file %s", input_file) + log.info("Resolving deprecated plugin %s -> %s", pdesc.name, new_repo.name) new_pdesc = PluginDesc(new_repo, pdesc.branch, pdesc.alias) + old_plugin, _ = prefetch_plugin(pdesc) new_plugin, _ = prefetch_plugin(new_pdesc) + if old_plugin.normalized_name != new_plugin.normalized_name: deprecations[old_plugin.normalized_name] = { "new": new_plugin.normalized_name, "date": cur_date_iso, } + + # remove plugin from index file, so we won't add it to deprecations again + for i, plugin in enumerate(plugins): + if plugin.name == pdesc.name: + plugins.pop(i) + break + plugins.append(new_pdesc) + with open(deprecated, "w") as f: json.dump(deprecations, f, indent=4, sort_keys=True) f.write("\n") @@ -772,7 +775,7 @@ def rewrite_input( fieldnames = ["repo", "branch", "alias"] writer = csv.DictWriter(f, fieldnames, dialect="unix", quoting=csv.QUOTE_NONE) writer.writeheader() - for plugin in sorted(plugins): + for plugin in sorted(plugins, key=lambda x: x.name): writer.writerow(asdict(plugin)) @@ -792,9 +795,11 @@ def update_plugins(editor: Editor, args): log.info("Start updating plugins") if args.proc > 1 and args.github_token == None: - log.warning("You have enabled parallel updates but haven't set a github token.\n" - "You may be hit with `HTTP Error 429: too many requests` as a consequence." - "Either set --proc=1 or --github-token=YOUR_TOKEN. ") + log.warning( + "You have enabled parallel updates but haven't set a github token.\n" + "You may be hit with `HTTP Error 429: too many requests` as a consequence." + "Either set --proc=1 or --github-token=YOUR_TOKEN. " + ) fetch_config = FetchConfig(args.proc, args.github_token) update = editor.get_update(args.input_file, args.outfile, fetch_config) @@ -810,11 +815,9 @@ def update_plugins(editor: Editor, args): if autocommit: try: repo = git.Repo(os.getcwd()) - updated = datetime.now(tz=UTC).strftime('%Y-%m-%d') + updated = datetime.now(tz=UTC).strftime("%Y-%m-%d") print(args.outfile) - commit(repo, - f"{editor.attr_path}: update on {updated}", [args.outfile] - ) + commit(repo, f"{editor.attr_path}: update on {updated}", [args.outfile]) except git.InvalidGitRepositoryError as e: print(f"Not in a git repository: {e}", file=sys.stderr) sys.exit(1) diff --git a/pkgs/applications/editors/kakoune/plugins/update.py b/pkgs/applications/editors/kakoune/plugins/update.py index 5e0ca51727c1bd..333c96807dd4ce 100755 --- a/pkgs/applications/editors/kakoune/plugins/update.py +++ b/pkgs/applications/editors/kakoune/plugins/update.py @@ -2,49 +2,63 @@ #!nix-shell update-shell.nix -i python3 # format: -# $ nix run nixpkgs.python3Packages.black -c black update.py +# $ nix run nixpkgs#python3Packages.ruff -- update.py # type-check: -# $ nix run nixpkgs.python3Packages.mypy -c mypy update.py +# $ nix run nixpkgs#python3Packages.mypy -- update.py # linted: -# $ nix run nixpkgs.python3Packages.flake8 -c flake8 --ignore E501,E265,E402 update.py +# $ nix run nixpkgs#python3Packages.flake8 -- --ignore E501,E265,E402 update.py import inspect import os import sys -from typing import List, Tuple from pathlib import Path +from typing import List, Tuple # Import plugin update library from maintainers/scripts/pluginupdate.py -ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) # type: ignore +ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) # type: ignore sys.path.insert( 0, os.path.join(ROOT.parent.parent.parent.parent.parent, "maintainers", "scripts") ) import pluginupdate -GET_PLUGINS = f"""(with import {{}}; +GET_PLUGINS = f"""( +with import {{ }}; let - inherit (kakouneUtils.override {{}}) buildKakounePluginFrom2Nix; + inherit (kakouneUtils.override {{ }}) buildKakounePluginFrom2Nix; generated = callPackage {ROOT}/generated.nix {{ inherit buildKakounePluginFrom2Nix; }}; - hasChecksum = value: lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value; - getChecksum = name: value: - if hasChecksum value then {{ - submodules = value.src.fetchSubmodules or false; - sha256 = value.src.outputHash; - rev = value.src.rev; - }} else null; + hasChecksum = + value: + lib.isAttrs value + && lib.hasAttrByPath [ + "src" + "outputHash" + ] value; + getChecksum = + name: value: + if hasChecksum value then + {{ + submodules = value.src.fetchSubmodules or false; + sha256 = value.src.outputHash; + rev = value.src.rev; + }} + else + null; checksums = lib.mapAttrs getChecksum generated; -in lib.filterAttrs (n: v: v != null) checksums)""" - -HEADER = "# This file has been generated by ./pkgs/applications/editors/kakoune/plugins/update.py. Do not edit!" - -class KakouneEditor(pluginupdate.Editor): +in +lib.filterAttrs (n: v: v != null) checksums +)""" +HEADER = "# This file has been @generated by ./pkgs/applications/editors/kakoune/plugins/update.py. Do not edit!" - def generate_nix(self, plugins: List[Tuple[pluginupdate.PluginDesc, pluginupdate.Plugin]], outfile: str): - sorted_plugins = sorted(plugins, key=lambda v: v[1].name.lower()) +class KakouneEditor(pluginupdate.Editor): + def generate_nix( + self, + plugins: List[Tuple[pluginupdate.PluginDesc, pluginupdate.Plugin]], + outfile: str, + ): with open(outfile, "w+") as f: f.write(HEADER) f.write( @@ -54,7 +68,7 @@ def generate_nix(self, plugins: List[Tuple[pluginupdate.PluginDesc, pluginupdate packages = ( self: {""" ) - for pluginDesc, plugin in sorted_plugins: + for pluginDesc, plugin in plugins: f.write( f""" {plugin.normalized_name} = buildKakounePluginFrom2Nix {{ diff --git a/pkgs/applications/editors/vim/plugins/update.py b/pkgs/applications/editors/vim/plugins/update.py index a8525b9018b57b..37c0adb6bb290a 100755 --- a/pkgs/applications/editors/vim/plugins/update.py +++ b/pkgs/applications/editors/vim/plugins/update.py @@ -3,7 +3,7 @@ # run with: # $ nix run .\#vimPluginsUpdater # format: -# $ nix run nixpkgs#python3Packages.black -- update.py +# $ nix run nixpkgs#python3Packages.ruff -- update.py # type-check: # $ nix run nixpkgs#python3Packages.mypy -- update.py # linted: @@ -19,30 +19,24 @@ # import inspect -import os -import logging -import textwrap import json +import logging +import os import subprocess -from typing import List, Tuple +import textwrap from pathlib import Path - +from typing import List, Tuple log = logging.getLogger("vim-updater") -sh = logging.StreamHandler() -formatter = logging.Formatter("%(name)s:%(levelname)s: %(message)s") -sh.setFormatter(formatter) -log.addHandler(sh) - # Import plugin update library from maintainers/scripts/pluginupdate.py ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) -import pluginupdate import importlib -from pluginupdate import run_nix_expr, PluginDesc -treesitter = importlib.import_module('nvim-treesitter.update') +import pluginupdate +from pluginupdate import PluginDesc, run_nix_expr +treesitter = importlib.import_module("nvim-treesitter.update") HEADER = ( @@ -56,17 +50,14 @@ class VimEditor(pluginupdate.Editor): nvim_treesitter_updated = False def generate_nix( - self, - plugins: List[Tuple[PluginDesc, pluginupdate.Plugin]], - outfile: str + self, plugins: List[Tuple[PluginDesc, pluginupdate.Plugin]], outfile: str ): log.info("Generating nix code") - sorted_plugins = sorted(plugins, key=lambda v: v[0].name.lower()) log.debug("Loading nvim-treesitter revision from nix...") nvim_treesitter_rev = pluginupdate.run_nix_expr( "(import { }).vimPlugins.nvim-treesitter.src.rev", self.nixpkgs, - timeout=10 + timeout=10, ) GET_PLUGINS_LUA = """ @@ -98,7 +89,7 @@ def _isNeovimPlugin(plug: pluginupdate.Plugin) -> bool: """ ) ) - for pdesc, plugin in sorted_plugins: + for pdesc, plugin in plugins: content = self.plugin2nix(pdesc, plugin, _isNeovimPlugin(plugin)) f.write(content) if ( @@ -109,8 +100,9 @@ def _isNeovimPlugin(plug: pluginupdate.Plugin) -> bool: f.write("\n}\n") print(f"updated {outfile}") - def plugin2nix(self, pdesc: PluginDesc, plugin: pluginupdate.Plugin, isNeovim: bool) -> str: - + def plugin2nix( + self, pdesc: PluginDesc, plugin: pluginupdate.Plugin, isNeovim: bool + ) -> str: repo = pdesc.repo content = f" {plugin.normalized_name} = " @@ -138,19 +130,25 @@ def update(self, args): if self.nvim_treesitter_updated: print("updating nvim-treesitter grammars") cmd = [ - "nix", "build", - "vimPlugins.nvim-treesitter.src", "-f", self.nixpkgs - , "--print-out-paths" + "nix", + "build", + "vimPlugins.nvim-treesitter.src", + "-f", + self.nixpkgs, + "--print-out-paths", ] log.debug("Running command: %s", " ".join(cmd)) - nvim_treesitter_dir = subprocess.check_output(cmd, text=True, timeout=90).strip() + nvim_treesitter_dir = subprocess.check_output( + cmd, text=True, timeout=90 + ).strip() generated = treesitter.update_grammars(nvim_treesitter_dir) treesitter_generated_nix_path = os.path.join( - NIXPKGS_NVIMTREESITTER_FOLDER, - "generated.nix" + NIXPKGS_NVIMTREESITTER_FOLDER, "generated.nix" + ) + open(os.path.join(args.nixpkgs, treesitter_generated_nix_path), "w").write( + generated ) - open(os.path.join(args.nixpkgs, treesitter_generated_nix_path), "w").write(generated) if self.nixpkgs_repo: index = self.nixpkgs_repo.index diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index c4d547e962e442..771abfc75b584a 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -113,9 +113,10 @@ https://github.com/AndrewRadev/bufferize.vim/,HEAD, https://github.com/akinsho/bufferline.nvim/,, https://github.com/kwkarlwang/bufjump.nvim/,HEAD, https://github.com/bullets-vim/bullets.vim/,, -https://github.com/mattn/calendar-vim/,,mattn-calendar-vim https://github.com/itchyny/calendar.vim/,, https://github.com/bkad/camelcasemotion/,, +https://github.com/catppuccin/nvim/,,catppuccin-nvim +https://github.com/catppuccin/vim/,HEAD,catppuccin-vim https://github.com/tyru/caw.vim/,, https://github.com/uga-rosa/ccc.nvim/,HEAD, https://github.com/Eandrju/cellular-automaton.nvim/,HEAD, @@ -150,6 +151,7 @@ https://github.com/delphinus/cmp-ctags/,HEAD, https://github.com/rcarriga/cmp-dap/,HEAD, https://github.com/uga-rosa/cmp-dictionary/,HEAD, https://github.com/dmitmel/cmp-digraphs/,HEAD, +https://github.com/SergioRibera/cmp-dotenv/,HEAD, https://github.com/hrsh7th/cmp-emoji/,, https://github.com/mtoohey31/cmp-fish/,HEAD, https://github.com/tzachar/cmp-fuzzy-buffer/,HEAD, @@ -295,6 +297,7 @@ https://github.com/direnv/direnv.vim/,, https://github.com/chipsenkbeil/distant.nvim/,HEAD, https://github.com/doki-theme/doki-theme-vim/,, https://github.com/NTBBloodbath/doom-one.nvim/,, +https://github.com/dracula/vim/,,dracula-vim https://github.com/Mofiqul/dracula.nvim/,HEAD, https://github.com/stevearc/dressing.nvim/,, https://github.com/Bekaboo/dropbar.nvim/,HEAD, @@ -309,6 +312,7 @@ https://github.com/creativenull/efmls-configs-nvim/,, https://github.com/elixir-tools/elixir-tools.nvim/,HEAD, https://github.com/elmcast/elm-vim/,, https://github.com/dmix/elvish.vim/,, +https://github.com/embark-theme/vim/,,embark-vim https://github.com/mattn/emmet-vim/,, https://github.com/vim-scripts/emodeline/,, https://github.com/vim-scripts/errormarker.vim/,, @@ -354,6 +358,7 @@ https://github.com/gfanto/fzf-lsp.nvim/,, https://github.com/ibhagwan/fzf-lua/,HEAD, https://github.com/junegunn/fzf.vim/,, https://github.com/NTBBloodbath/galaxyline.nvim/,, +https://github.com/gbprod/nord.nvim/,,gbprod-nord https://github.com/jsfaint/gen_tags.vim/,, https://github.com/gentoo/gentoo-syntax/,, https://github.com/ndmitchell/ghcid/,, @@ -382,9 +387,9 @@ https://github.com/liuchengxu/graphviz.vim/,, https://github.com/cbochs/grapple.nvim/,HEAD, https://github.com/blazkowolf/gruber-darker.nvim/,, https://github.com/MagicDuck/grug-far.nvim/,, -https://github.com/gruvbox-community/gruvbox/,,gruvbox-community https://github.com/morhetz/gruvbox/,, https://github.com/luisiacc/gruvbox-baby/,HEAD, +https://github.com/gruvbox-community/gruvbox/,,gruvbox-community https://github.com/eddyekofo94/gruvbox-flat.nvim/,, https://github.com/sainnhe/gruvbox-material/,, https://github.com/f4z3r/gruvbox-material.nvim/,HEAD, @@ -426,7 +431,6 @@ https://github.com/idris-hackers/idris-vim/,, https://github.com/ShinKage/idris2-nvim/,, https://github.com/edwinb/idris2-vim/,, https://github.com/3rd/image.nvim/,HEAD, -https://github.com/samodostal/image.nvim/,HEAD,samodostal-image-nvim https://github.com/HakonHarnes/img-clip.nvim/,HEAD, https://github.com/lewis6991/impatient.nvim/,, https://github.com/backdround/improved-search.nvim/,HEAD, @@ -533,6 +537,7 @@ https://github.com/williamboman/mason.nvim/,HEAD, https://github.com/vim-scripts/matchit.zip/,, https://github.com/marko-cerovac/material.nvim/,, https://github.com/kaicataldo/material.vim/,HEAD, +https://github.com/mattn/calendar-vim/,,mattn-calendar-vim https://github.com/vim-scripts/mayansmoke/,, https://github.com/chikamichi/mediawiki.vim/,HEAD, https://github.com/savq/melange-nvim/,, @@ -591,7 +596,6 @@ https://github.com/miikanissi/modus-themes.nvim/,HEAD, https://github.com/tomasr/molokai/,, https://github.com/benlubas/molten-nvim/,HEAD, https://github.com/loctvl842/monokai-pro.nvim/,HEAD, -https://github.com/shaunsingh/moonlight.nvim/,,pure-lua https://github.com/leafo/moonscript-vim/,HEAD, https://github.com/yegappan/mru/,, https://github.com/smoka7/multicursors.nvim/,HEAD, @@ -661,7 +665,6 @@ https://github.com/stevanmilic/neotest-scala/,HEAD, https://github.com/shunsambongi/neotest-testthat/,HEAD, https://github.com/marilari88/neotest-vitest/,HEAD, https://github.com/lawrence-laz/neotest-zig/,HEAD, -https://github.com/rose-pine/neovim/,main,rose-pine https://github.com/Shatur/neovim-ayu/,, https://github.com/cloudhead/neovim-fuzzy/,, https://github.com/jeffkreeftmeijer/neovim-sensible/,, @@ -676,6 +679,7 @@ https://github.com/fiatjaf/neuron.vim/,, https://github.com/Olical/nfnl/,main, https://github.com/chr4/nginx.vim/,, https://github.com/oxfist/night-owl.nvim/,, +https://github.com/bluz71/vim-nightfly-colors/,,nightfly https://github.com/EdenEast/nightfox.nvim/,, https://github.com/Alexis12119/nightly.nvim/,, https://github.com/zah/nim.vim/,, @@ -687,7 +691,7 @@ https://github.com/shortcuts/no-neck-pain.nvim/,HEAD, https://github.com/kartikp10/noctis.nvim/,, https://github.com/folke/noice.nvim/,HEAD, https://github.com/nvimtools/none-ls.nvim/,HEAD, -https://github.com/gbprod/nord.nvim/,,gbprod-nord +https://github.com/nordtheme/vim/,,nord-vim https://github.com/shaunsingh/nord.nvim/,, https://github.com/andersevenrud/nordic.nvim/,, https://github.com/vigoux/notifier.nvim/,HEAD, @@ -696,8 +700,8 @@ https://github.com/MunifTanjim/nui.nvim/,main, https://github.com/jose-elias-alvarez/null-ls.nvim/,, https://github.com/nacro90/numb.nvim/,, https://github.com/nvchad/nvchad/,HEAD, +https://github.com/nvchad/ui/,HEAD,nvchad-ui https://github.com/ChristianChiarulli/nvcode-color-schemes.vim/,, -https://github.com/catppuccin/nvim/,,catppuccin-nvim https://github.com/AckslD/nvim-FeMaco.lua/,HEAD, https://github.com/nathanmsmith/nvim-ale-diagnostic/,, https://github.com/windwp/nvim-autopairs/,, @@ -838,6 +842,7 @@ https://github.com/olimorris/persisted.nvim/,HEAD, https://github.com/folke/persistence.nvim/,, https://github.com/pest-parser/pest.vim/,HEAD, https://github.com/lifepillar/pgsql.vim/,, +https://github.com/phha/zenburn.nvim/,,phha-zenburn https://github.com/motus/pig.vim/,, https://github.com/weirongxu/plantuml-previewer.vim/,HEAD, https://github.com/aklt/plantuml-syntax/,, @@ -857,6 +862,7 @@ https://github.com/ahmedkhalf/project.nvim/,, https://github.com/kevinhwang91/promise-async/,HEAD, https://github.com/frigoeu/psc-ide-vim/,, https://github.com/Shougo/pum.vim/,HEAD, +https://github.com/shaunsingh/moonlight.nvim/,,pure-lua https://github.com/purescript-contrib/purescript-vim/,, https://github.com/python-mode/python-mode/,, https://github.com/vim-python/python-syntax/,, @@ -889,6 +895,7 @@ https://github.com/gu-fan/riv.vim/,, https://github.com/kevinhwang91/rnvimr/,, https://github.com/mfukar/robotframework-vim/,, https://github.com/ron-rs/ron.vim/,, +https://github.com/rose-pine/neovim/,main,rose-pine https://github.com/jmederosalvarado/roslyn.nvim/,HEAD, https://github.com/keith/rspec.vim/,, https://github.com/ccarpita/rtorrent-syntax-file/,, @@ -896,6 +903,7 @@ https://github.com/simrat39/rust-tools.nvim/,, https://github.com/rust-lang/rust.vim/,, https://github.com/hauleth/sad.vim/,, https://github.com/vmware-archive/salt-vim/,, +https://github.com/samodostal/image.nvim/,HEAD,samodostal-image-nvim https://github.com/lewis6991/satellite.nvim/,HEAD, https://github.com/davidgranstrom/scnvim/,HEAD, https://github.com/tiagovla/scope.nvim/,HEAD, @@ -1048,7 +1056,6 @@ https://github.com/pmizio/typescript-tools.nvim/,, https://github.com/leafgarland/typescript-vim/,, https://github.com/jose-elias-alvarez/typescript.nvim/,, https://github.com/kaarmu/typst.vim/,HEAD, -https://github.com/nvchad/ui/,HEAD,nvchad-ui https://github.com/altermo/ultimate-autopair.nvim/,HEAD, https://github.com/SirVer/ultisnips/,, https://github.com/mbbill/undotree/,, @@ -1063,11 +1070,6 @@ https://github.com/junegunn/vader.vim/,, https://github.com/jbyuki/venn.nvim/,, https://github.com/vhda/verilog_systemverilog.vim/,, https://github.com/vifm/vifm.vim/,, -https://github.com/nordtheme/vim/,,nord-vim -https://github.com/dracula/vim/,,dracula-vim -https://github.com/embark-theme/vim/,,embark-vim -https://github.com/catppuccin/vim/,HEAD,catppuccin-vim -https://github.com/inkarkat/vim-AdvancedSorters/,,vim-advanced-sorters https://github.com/Konfekt/vim-CtrlXA/,, https://github.com/konfekt/vim-DetectSpellLang/,, https://github.com/dpelle/vim-LanguageTool/,, @@ -1094,6 +1096,7 @@ https://github.com/MarcWeber/vim-addon-sql/,, https://github.com/MarcWeber/vim-addon-syntax-checker/,, https://github.com/MarcWeber/vim-addon-toggle-buffer/,, https://github.com/MarcWeber/vim-addon-xdebug/,, +https://github.com/inkarkat/vim-AdvancedSorters/,,vim-advanced-sorters https://github.com/junegunn/vim-after-object/,, https://github.com/danilo-augusto/vim-afterglow/,HEAD, https://github.com/msuperdock/vim-agda/,HEAD, @@ -1170,6 +1173,7 @@ https://github.com/kristijanhusak/vim-dirvish-git/,, https://github.com/tpope/vim-dispatch/,, https://github.com/radenling/vim-dispatch-neovim/,, https://github.com/jhradilek/vim-docbk/,, +https://github.com/jhradilek/vim-snippets/,,vim-docbk-snippets https://github.com/tpope/vim-dotenv/,, https://github.com/junegunn/vim-easy-align/,, https://github.com/zhou13/vim-easyescape/,, @@ -1323,7 +1327,6 @@ https://github.com/jistr/vim-nerdtree-tabs/,, https://github.com/nfnty/vim-nftables/,, https://github.com/kana/vim-niceblock/,, https://github.com/nickel-lang/vim-nickel/,main, -https://github.com/bluz71/vim-nightfly-colors/,,nightfly https://github.com/tommcdo/vim-ninja-feet/,, https://github.com/LnL7/vim-nix/,, https://github.com/symphorien/vim-nixhash/,, @@ -1415,7 +1418,6 @@ https://github.com/bohlender/vim-smt2/,, https://github.com/justinmk/vim-sneak/,, https://github.com/garbas/vim-snipmate/,, https://github.com/honza/vim-snippets/,, -https://github.com/jhradilek/vim-snippets/,,vim-docbk-snippets https://github.com/lifepillar/vim-solarized8/,HEAD, https://github.com/tomlion/vim-solidity/,, https://github.com/christoomey/vim-sort-motion/,, @@ -1544,7 +1546,6 @@ https://github.com/Lilja/zellij.nvim/,HEAD, https://github.com/folke/zen-mode.nvim/,, https://github.com/zenbones-theme/zenbones.nvim/,HEAD, https://github.com/jnurmine/zenburn/,, -https://github.com/phha/zenburn.nvim/,,phha-zenburn https://github.com/nvimdev/zephyr-nvim/,, https://github.com/ziglang/zig.vim/,, https://github.com/zk-org/zk-nvim/,HEAD, diff --git a/pkgs/by-name/lu/luarocks-packages-updater/updater.py b/pkgs/by-name/lu/luarocks-packages-updater/updater.py index 91194879b875e4..2471e46f5f4271 100755 --- a/pkgs/by-name/lu/luarocks-packages-updater/updater.py +++ b/pkgs/by-name/lu/luarocks-packages-updater/updater.py @@ -1,26 +1,26 @@ #!/usr/bin/env python # format: -# $ nix run nixpkgs#python3Packages.black -- update.py +# $ nix run nixpkgs#python3Packages.ruff -- update.py # type-check: # $ nix run nixpkgs#python3Packages.mypy -- update.py # linted: # $ nix run nixpkgs#python3Packages.flake8 -- --ignore E501,E265,E402 update.py +import csv import inspect +import logging import os -import tempfile import shutil -from dataclasses import dataclass import subprocess -import csv -import logging +import tempfile import textwrap +from dataclasses import dataclass from multiprocessing.dummy import Pool -import pluginupdate -from pluginupdate import update_plugins, FetchConfig - -from typing import List, Tuple, Optional from pathlib import Path +from typing import List, Optional, Tuple + +import pluginupdate +from pluginupdate import FetchConfig, update_plugins log = logging.getLogger() log.addHandler(logging.StreamHandler()) @@ -35,9 +35,7 @@ Regenerate it with: nix run nixpkgs#luarocks-packages-updater You can customize the generated packages in pkgs/development/lua-modules/overrides.nix */ -""".format( - GENERATED_NIXFILE=GENERATED_NIXFILE -) +""".format(GENERATED_NIXFILE=GENERATED_NIXFILE) FOOTER = """ } @@ -71,7 +69,6 @@ def normalized_name(self) -> str: # rename Editor to LangUpdate/ EcosystemUpdater class LuaEditor(pluginupdate.Editor): - def create_parser(self): parser = super().create_parser() parser.set_defaults(proc=1) @@ -173,10 +170,7 @@ def generate_pkg_nix(plug: LuaPlugin): if plug.rockspec != "": if plug.ref or plug.version: - msg = ( - "'version' and 'ref' will be ignored as the rockspec is hardcoded for package %s" - % plug.name - ) + msg = "'version' and 'ref' will be ignored as the rockspec is hardcoded for package %s" % plug.name log.warning(msg) log.debug("Updating from rockspec %s", plug.rockspec) @@ -193,7 +187,7 @@ def generate_pkg_nix(plug: LuaPlugin): if plug.luaversion: cmd.append(f"--lua-version={plug.luaversion}") - luaver = plug.luaversion.replace('.', '') + luaver = plug.luaversion.replace(".", "") if luaver := os.getenv(f"LUA_{luaver}"): cmd.append(f"--lua-dir={luaver}")