diff options
| author | 2026-01-10 01:04:48 +0000 | |
|---|---|---|
| committer | 2026-01-10 01:04:48 +0000 | |
| commit | c57ce3c8e69a301f67f105641d26b3cf9b4bb9e3 (patch) | |
| tree | 1d4036ae7476dc84ce367c3567501be22c9a974c /pkgs/pywikibotPackages | |
| parent | pkgs: i don't need inherit (diff) | |
| signature | ||
pkgs: move pywikibot to it's own pywikibotPackages
Diffstat (limited to 'pkgs/pywikibotPackages')
| -rw-r--r-- | pkgs/pywikibotPackages/default.nix | 11 | ||||
| -rw-r--r-- | pkgs/pywikibotPackages/pywb/default.nix | 33 | ||||
| -rw-r--r-- | pkgs/pywikibotPackages/pywikibot-scripts/default.nix | 40 | ||||
| -rw-r--r-- | pkgs/pywikibotPackages/pywikibot-scripts/setup.py | 19 | ||||
| -rw-r--r-- | pkgs/pywikibotPackages/pywikibot/default.nix | 7 |
5 files changed, 110 insertions, 0 deletions
diff --git a/pkgs/pywikibotPackages/default.nix b/pkgs/pywikibotPackages/default.nix new file mode 100644 index 0000000..9e22141 --- /dev/null +++ b/pkgs/pywikibotPackages/default.nix @@ -0,0 +1,11 @@ +{ lib, newScope }: + +lib.makeScope newScope (self: { + + /*example = self.call Package ./example { };*/ + + pywikibot-scripts = self.callPackage ./pywikibot-scripts { }; + pywikibot = self.callPackage ./pywikibot { }; + pywb = self.callPackage ./pywb { }; + +}) diff --git a/pkgs/pywikibotPackages/pywb/default.nix b/pkgs/pywikibotPackages/pywb/default.nix new file mode 100644 index 0000000..604f92e --- /dev/null +++ b/pkgs/pywikibotPackages/pywb/default.nix @@ -0,0 +1,33 @@ +{ lib +, writeShellApplication +, python3 +, pywikibot-scripts +, pywikibot +}: + +writeShellApplication { + name = "pywb"; + text = '' + pwbs="${pywikibot-scripts}/${python3.sitePackages}/scripts" + cmd="''${1:-}"; shift + if [ -z "$cmd" ]; then + echo "not specified command to run" >&2 + exit 2 + fi + if [ -f "$pwbs/$cmd.py" ]; then + exec "${pywikibot}/bin/pwb" "$pwbs/$cmd" "$@" + elif [ -f "$pwbs/$cmd" ]; then + exec "${pywikibot}/bin/pwb" "$pwbs/$cmd" "$@" + else + if [ "$cmd" = "__get_path" ]; then + echo "$pwbs" + exit + elif [ "$cmd" = "--ls" ]; then + ls "$pwbs" "$@" + exit + fi + echo "$cmd not found in pywkibot's scripts folder (make sure it doesn't end in .py)" >&2 + exit 1 + fi + ''; +} diff --git a/pkgs/pywikibotPackages/pywikibot-scripts/default.nix b/pkgs/pywikibotPackages/pywikibot-scripts/default.nix new file mode 100644 index 0000000..1d12d42 --- /dev/null +++ b/pkgs/pywikibotPackages/pywikibot-scripts/default.nix @@ -0,0 +1,40 @@ +{ + lib, + fetchgit, + python3, + python3Packages, + stdenv, +}: + +python3Packages.buildPythonPackage rec { + pname = "scripts"; + version = "10.7.0"; + pyproject = true; + build-system = [ python3Packages.setuptools ]; + + disabled = python3Packages.pythonOlder "3.8"; + + src = fetchgit { + url = "https://gerrit.wikimedia.org/r/pywikibot/core"; + rev = "f1b4b4d0cfbc199c36fb72570425328daa93b067"; + fetchSubmodules = true; + hash = "sha256-L/Yz9yidpTV7WCqHs2L6lFw/CpQyZ1UNd+NpMLJT0Hs="; + }; + + postPatch = '' + rm pyproject.toml setup.py + cp ${./setup.py} ./setup.py + ''; + + doCheck = false; + + pythonImportsCheck = [ "scripts" "scripts.i18n" ]; + + meta = { + description = "Python MediaWiki bot framework scripts"; + homepage = "https://www.mediawiki.org/wiki/Manual:Pywikibot"; + changelog = "https://doc.wikimedia.org/pywikibot/master/changelog.html"; + license = lib.licenses.mit; + #maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/pywikibotPackages/pywikibot-scripts/setup.py b/pkgs/pywikibotPackages/pywikibot-scripts/setup.py new file mode 100644 index 0000000..b37eb2e --- /dev/null +++ b/pkgs/pywikibotPackages/pywikibot-scripts/setup.py @@ -0,0 +1,19 @@ +from setuptools import setup + +setup(**{ + 'name': 'scripts', + 'version': '0.0.0', + 'description': 'Scripts from pywikibot', + 'long_description': None, + 'author': None, + 'author_email': None, + 'maintainer': None, + 'maintainer_email': None, + 'url': None, + 'packages': ['scripts', 'scripts.i18n'], + 'package_data': {'': ['*'], 'scripts.i18n': ['*.json', '*/*.json']}, + 'install_requires': [], + 'entry_points': {}, + 'python_requires': '', + 'include_package_data': True, +}) diff --git a/pkgs/pywikibotPackages/pywikibot/default.nix b/pkgs/pywikibotPackages/pywikibot/default.nix new file mode 100644 index 0000000..55aac46 --- /dev/null +++ b/pkgs/pywikibotPackages/pywikibot/default.nix @@ -0,0 +1,7 @@ +{ python3Packages +, pywikibot-scripts +}: + +python3Packages.pywikibot.overridePythonAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or []) ++ [ pywikibot-scripts ]; +}) |
