diff options
Diffstat (limited to 'maintainers')
-rw-r--r-- | maintainers/maintainer-list.nix | 65 | ||||
-rw-r--r-- | maintainers/scripts/pluginupdate.py | 15 | ||||
-rwxr-xr-x | maintainers/scripts/update-luarocks-packages | 224 | ||||
-rw-r--r-- | maintainers/scripts/update-luarocks-shell.nix | 13 |
4 files changed, 76 insertions, 241 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index a00b568cb0068..99af23423d48a 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -446,6 +446,13 @@ githubId = 25236206; name = "Adrian Dole"; }; + adriangl = { + email = "adrian@lauterer.it"; + matrix = "@adriangl:pvv.ntnu.no"; + github = "adrlau"; + githubId = 25004152; + name = "Adrian Gunnar Lauterer"; + }; AdsonCicilioti = { name = "Adson Cicilioti"; email = "adson.cicilioti@live.com"; @@ -3048,6 +3055,9 @@ email = "chayleaf-nix@pavluk.org"; github = "chayleaf"; githubId = 9590981; + keys = [{ + fingerprint = "4314 3701 154D 9E5F 7051 7ECF 7817 1AD4 6227 E68E"; + }]; matrix = "@chayleaf:matrix.pavluk.org"; name = "Anna Pavlyuk"; }; @@ -3680,6 +3690,15 @@ fingerprint = "2017 E152 BB81 5C16 955C E612 45BC C1E2 709B 1788"; }]; }; + Cryolitia = { + name = "Beiyan Cryolitia"; + email = "Cryolitia@gmail.com"; + github = "Cryolitia"; + githubId = 23723294; + keys = [{ + fingerprint = "1C3C 6547 538D 7152 310C 0EEA 84DD 0C01 30A5 4DF7"; + }]; + }; cryptix = { email = "cryptix@riseup.net"; github = "cryptix"; @@ -5960,6 +5979,11 @@ githubId = 119691; name = "Michael Gough"; }; + franciscod = { + github = "franciscod"; + githubId = 726447; + name = "Francisco Demartino"; + }; franzmondlichtmann = { name = "Franz Schroepf"; email = "franz-schroepf@t-online.de"; @@ -6102,7 +6126,7 @@ }; fugi = { email = "me@fugi.dev"; - github = "FugiMuffi"; + github = "fugidev"; githubId = 21362942; name = "Fugi"; }; @@ -6469,6 +6493,12 @@ githubId = 1713676; name = "Luis G. Torres"; }; + giomf = { + email = "giomf@mailbox.org"; + github = "giomf"; + githubId = 35076723; + name = "Guillaume Fournier"; + }; giorgiga = { email = "giorgio.gallo@bitnic.it"; github = "giorgiga"; @@ -12108,6 +12138,14 @@ github = "MrTarantoga"; githubId = 53876219; }; + mrtnvgr = { + name = "Egor Martynov"; + github = "mrtnvgr"; + githubId = 48406064; + keys = [{ + fingerprint = "6FAD DB43 D5A5 FE52 6835 0943 5B33 79E9 81EF 48B1"; + }]; + }; mrVanDalo = { email = "contact@ingolf-wagner.de"; github = "mrVanDalo"; @@ -13610,6 +13648,11 @@ githubId = 15645854; name = "Brad Christensen"; }; + paumr = { + github = "paumr"; + name = "Michael Bergmeister"; + githubId = 53442728; + }; paveloom = { email = "paveloom@riseup.net"; github = "paveloom"; @@ -14045,6 +14088,13 @@ githubId = 13000278; name = "Maksim Bronsky"; }; + plusgut = { + name = "Carlo Jeske"; + email = "carlo.jeske+nixpkgs@webentwickler2-0.de"; + github = "plusgut"; + githubId = 277935; + matrix = "@plusgut5:matrix.org"; + }; PlushBeaver = { name = "Dmitry Kozlyuk"; email = "dmitry.kozliuk+nixpkgs@gmail.com"; @@ -17136,6 +17186,12 @@ githubId = 7075751; name = "Patrick Hilhorst"; }; + sysedwinistrator = { + email = "edwin.mowen@gmail.com"; + github = "sysedwinistrator"; + githubId = 71331875; + name = "Edwin Mackenzie-Owen"; + }; szczyp = { email = "qb@szczyp.com"; github = "Szczyp"; @@ -18854,6 +18910,13 @@ fingerprint = "47F7 009E 3AE3 1DA7 988E 12E1 8C9B 0A8F C0C0 D862"; }]; }; + wamirez = { + email = "wamirez@protonmail.com"; + matrix = "@wamirez:matrix.org"; + github = "wamirez"; + githubId = 24505474; + name = "Daniel Ramirez"; + }; wamserma = { name = "Markus S. Wamser"; email = "github-dev@mail2013.wamser.eu"; diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py index 52e9af399709b..44a445875d918 100644 --- a/maintainers/scripts/pluginupdate.py +++ b/maintainers/scripts/pluginupdate.py @@ -468,6 +468,7 @@ class Editor: "--input-names", "-i", dest="input_file", + type=Path, default=self.default_in, help="A list of plugins in the form owner/repo", ) @@ -476,6 +477,7 @@ class Editor: "-o", dest="outfile", default=self.default_out, + type=Path, help="Filename to save generated nix code", ) common.add_argument( @@ -787,10 +789,17 @@ def update_plugins(editor: Editor, args): if autocommit: from datetime import date - editor.nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True) - updated = date.today().strftime('%m-%d-%Y') - commit(editor.nixpkgs_repo, f"{editor.attr_path}: updated the {updated}", [args.outfile]) + try: + repo = git.Repo(os.getcwd()) + updated = date.today().strftime('%m-%d-%Y') + print(args.outfile) + commit(repo, + f"{editor.attr_path}: updated the {updated}", [args.outfile] + ) + except git.InvalidGitRepositoryError as e: + print(f"Not in a git repository: {e}", file=sys.stderr) + sys.exit(1) if redirects: update() diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages deleted file mode 100755 index 32c2b44260b32..0000000000000 --- a/maintainers/scripts/update-luarocks-packages +++ /dev/null @@ -1,224 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell update-luarocks-shell.nix -i python3 - -# format: -# $ nix run nixpkgs#python3Packages.black -- update.py -# type-check: -# $ nix run nixpkgs#python3Packages.mypy -- update.py -# linted: -# $ nix run nixpkgs#python3Packages.flake8 -- --ignore E501,E265,E402 update.py - -import inspect -import os -import tempfile -import shutil -from dataclasses import dataclass -import subprocess -import csv -import logging -import textwrap -from multiprocessing.dummy import Pool - -from typing import List, Tuple, Optional -from pathlib import Path - -log = logging.getLogger() -log.addHandler(logging.StreamHandler()) - -ROOT = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))).parent.parent # type: ignore -import pluginupdate -from pluginupdate import update_plugins, FetchConfig, CleanEnvironment - -PKG_LIST = "maintainers/scripts/luarocks-packages.csv" -TMP_FILE = "$(mktemp)" -GENERATED_NIXFILE = "pkgs/development/lua-modules/generated-packages.nix" -LUAROCKS_CONFIG = "maintainers/scripts/luarocks-config.lua" - -HEADER = """/* {GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT! -Regenerate it with: -nixpkgs$ ./maintainers/scripts/update-luarocks-packages - -You can customize the generated packages in pkgs/development/lua-modules/overrides.nix -*/ -""".format( - GENERATED_NIXFILE=GENERATED_NIXFILE -) - -FOOTER = """ -} -/* GENERATED - do not edit this file */ -""" - - -@dataclass -class LuaPlugin: - name: str - """Name of the plugin, as seen on luarocks.org""" - src: str - """address to the git repository""" - ref: Optional[str] - """git reference (branch name/tag)""" - version: Optional[str] - """Set it to pin a package """ - server: Optional[str] - """luarocks.org registers packages under different manifests. - Its value can be 'http://luarocks.org/dev' - """ - luaversion: Optional[str] - """Attribue of the lua interpreter if a package is available only for a specific lua version""" - maintainers: Optional[str] - """ Optional string listing maintainers separated by spaces""" - - @property - def normalized_name(self) -> str: - return self.name.replace(".", "-") - - -# rename Editor to LangUpdate/ EcosystemUpdater -class LuaEditor(pluginupdate.Editor): - def get_current_plugins(self): - return [] - - def load_plugin_spec(self, input_file) -> List[LuaPlugin]: - luaPackages = [] - csvfilename = input_file - log.info("Loading package descriptions from %s", csvfilename) - - with open(csvfilename, newline="") as csvfile: - reader = csv.DictReader( - csvfile, - ) - for row in reader: - # name,server,version,luaversion,maintainers - plugin = LuaPlugin(**row) - luaPackages.append(plugin) - return luaPackages - - def update(self, args): - update_plugins(self, args) - - def generate_nix(self, results: List[Tuple[LuaPlugin, str]], outfilename: str): - with tempfile.NamedTemporaryFile("w+") as f: - f.write(HEADER) - header2 = textwrap.dedent( - # header2 = inspect.cleandoc( - """ - { self, stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args: - final: prev: - { - """ - ) - f.write(header2) - for plugin, nix_expr in results: - f.write(f"{plugin.normalized_name} = {nix_expr}") - f.write(FOOTER) - f.flush() - - # if everything went fine, move the generated file to its destination - # using copy since move doesn't work across disks - shutil.copy(f.name, outfilename) - - print(f"updated {outfilename}") - - @property - def attr_path(self): - return "luaPackages" - - def get_update(self, input_file: str, outfile: str, config: FetchConfig): - _prefetch = generate_pkg_nix - - def update() -> dict: - plugin_specs = self.load_plugin_spec(input_file) - sorted_plugin_specs = sorted(plugin_specs, key=lambda v: v.name.lower()) - - try: - pool = Pool(processes=config.proc) - results = pool.map(_prefetch, sorted_plugin_specs) - finally: - pass - - self.generate_nix(results, outfile) - - redirects = {} - return redirects - - return update - - def rewrite_input(self, input_file: str, *args, **kwargs): - # vim plugin reads the file before update but that shouldn't be our case - # not implemented yet - # fieldnames = ['name', 'server', 'version', 'luaversion', 'maintainers'] - # input_file = "toto.csv" - # with open(input_file, newline='') as csvfile: - # writer = csv.DictWriter(csvfile, fieldnames=fieldnames) - # writer.writeheader() - # for row in reader: - # # name,server,version,luaversion,maintainers - # plugin = LuaPlugin(**row) - # luaPackages.append(plugin) - pass - - -def generate_pkg_nix(plug: LuaPlugin): - """ - Generate nix expression for a luarocks package - Our cache key associates "p.name-p.version" to its rockspec - """ - log.debug("Generating nix expression for %s", plug.name) - custom_env = os.environ.copy() - custom_env["LUAROCKS_CONFIG"] = LUAROCKS_CONFIG - - # we add --dev else luarocks wont find all the "scm" (=dev) versions of the - # packages - # , "--dev" - cmd = ["luarocks", "nix"] - - if plug.maintainers: - cmd.append(f"--maintainers={plug.maintainers}") - - # if plug.server == "src": - if plug.src != "": - if plug.src is None: - msg = ( - "src must be set when 'version' is set to \"src\" for package %s" - % plug.name - ) - log.error(msg) - raise RuntimeError(msg) - log.debug("Updating from source %s", plug.src) - cmd.append(plug.src) - # update the plugin from luarocks - else: - cmd.append(plug.name) - if plug.version and plug.version != "src": - cmd.append(plug.version) - - if plug.server != "src" and plug.server: - cmd.append(f"--only-server={plug.server}") - - if plug.luaversion: - cmd.append(f"--lua-version={plug.luaversion}") - - log.debug("running %s", " ".join(cmd)) - - output = subprocess.check_output(cmd, env=custom_env, text=True) - output = "callPackage(" + output.strip() + ") {};\n\n" - return (plug, output) - - -def main(): - editor = LuaEditor( - "lua", - ROOT, - "", - default_in=ROOT.joinpath(PKG_LIST), - default_out=ROOT.joinpath(GENERATED_NIXFILE), - ) - - editor.run() - - -if __name__ == "__main__": - main() - -# vim: set ft=python noet fdm=manual fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : diff --git a/maintainers/scripts/update-luarocks-shell.nix b/maintainers/scripts/update-luarocks-shell.nix deleted file mode 100644 index 346b0319b08c9..0000000000000 --- a/maintainers/scripts/update-luarocks-shell.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ nixpkgs ? import ../.. { } -}: -with nixpkgs; -let - pyEnv = python3.withPackages(ps: [ ps.gitpython ]); -in -mkShell { - packages = [ - pyEnv - luarocks-nix - nix-prefetch-scripts - ]; -} |