summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar klea2025-12-11 19:45:30 +0000
committerGravatar klea2025-12-11 19:51:28 +0000
commit9f5d340d1ef627e6d9350cf31b89e62868f30b02 (patch)
tree86c7a7d2c75ffade2a428524188187caf8547d77
parenttry to deflakify it (broken commit) (diff)
signature
try to make scripts work in nix
the wrapper is annoying me
-rw-r--r--pkgs/default.nix3
-rw-r--r--pkgs/pywikibot-scripts/default.nix22
-rw-r--r--pkgs/pywikibot-scripts/setup.py18
-rw-r--r--pkgs/pywikibot/default.nix7
-rw-r--r--pkgs/shell/default.nix8
l---------pywb/python-import-path/pywikibot_scripts1
m---------pywikibot-core0
-rw-r--r--user-config.py4
8 files changed, 42 insertions, 21 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index fc1a96c..aee22c3 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -5,7 +5,8 @@ lib.makeScope newScope (self: {
/*example = self.callPackage ./example { };*/
pywikibot-scripts = self.callPackage ./pywikibot-scripts { };
+ pywikibot = self.callPackage ./pywikibot { pywikibot-scripts = self.pywikibot-scripts; };
- shell = self.callPackage ./shell { pywikibot-scripts = self.pywikibot-scripts; };
+ shell = self.callPackage ./shell { pywikibot = self.pywikibot; };
})
diff --git a/pkgs/pywikibot-scripts/default.nix b/pkgs/pywikibot-scripts/default.nix
index d5ea238..584ad28 100644
--- a/pkgs/pywikibot-scripts/default.nix
+++ b/pkgs/pywikibot-scripts/default.nix
@@ -1,34 +1,34 @@
{
lib,
fetchgit,
+ python3,
python3Packages,
+ stdenv,
}:
python3Packages.buildPythonPackage rec {
- pname = "pywikibot-scripts";
+ pname = "scripts";
version = "10.7.0";
- format = "pyproject";
+ pyproject = true;
+ build-system = [ python3Packages.setuptools ];
disabled = python3Packages.pythonOlder "3.8";
src = fetchgit {
url = "https://gerrit.wikimedia.org/r/pywikibot/core";
rev = "f1b4b4d0cfbc199c36fb72570425328daa93b067";
- sparseCheckout = [ "pywikibot/scripts" "scripts" ];
fetchSubmodules = true;
- hash = "sha256-MXwrn3WLWmddZRKNryELDRlKmqCqj/6WGDJJbnRAiZs=";
+ hash = "sha256-L/Yz9yidpTV7WCqHs2L6lFw/CpQyZ1UNd+NpMLJT0Hs=";
};
- propagatedBuildInputs = [
- python3Packages.mwparserfromhell
- python3Packages.requests
- python3Packages.setuptools
- ];
+ postPatch = ''
+ rm pyproject.toml setup.py
+ cp ${./setup.py} ./setup.py
+ '';
- # Tests attempt to install a tool using pip, which fails due to the sandbox
doCheck = false;
- pythonImportsCheck = [ "pywikibot.scripts" ];
+ pythonImportsCheck = [ "scripts" ];
meta = {
description = "Python MediaWiki bot framework scripts";
diff --git a/pkgs/pywikibot-scripts/setup.py b/pkgs/pywikibot-scripts/setup.py
new file mode 100644
index 0000000..7f00ffc
--- /dev/null
+++ b/pkgs/pywikibot-scripts/setup.py
@@ -0,0 +1,18 @@
+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'],
+ 'package_data': {'': ['*']},
+ 'install_requires': [],
+ 'entry_points': {},
+ 'python_requires': '',
+})
diff --git a/pkgs/pywikibot/default.nix b/pkgs/pywikibot/default.nix
new file mode 100644
index 0000000..2be3bcb
--- /dev/null
+++ b/pkgs/pywikibot/default.nix
@@ -0,0 +1,7 @@
+{ python3Packages
+, pywikibot-scripts
+}:
+
+python3Packages.pywikibot.overridePythonAttrs (old: {
+ propagatedBuildInputs = old.propagatedBuildInputs ++ [ pywikibot-scripts ];
+})
diff --git a/pkgs/shell/default.nix b/pkgs/shell/default.nix
index 9dfba08..85fa3a7 100644
--- a/pkgs/shell/default.nix
+++ b/pkgs/shell/default.nix
@@ -7,7 +7,7 @@
, fossil
, git
, internetarchive
-, pywikibot-scripts
+, pywikibot
}:
mkShellNoCC {
@@ -15,11 +15,9 @@ mkShellNoCC {
(python3.withPackages (p: [
p.requests
p.lxml
- p.pywikibot
- pywikibot-scripts
+ pywikibot
]))
- python3Packages.pywikibot
- pywikibot-scripts
+ pywikibot
websocat # connect to websocket
jq
libfaketime # used by my fossil script
diff --git a/pywb/python-import-path/pywikibot_scripts b/pywb/python-import-path/pywikibot_scripts
deleted file mode 120000
index 2042976..0000000
--- a/pywb/python-import-path/pywikibot_scripts
+++ /dev/null
@@ -1 +0,0 @@
-../../pywikibot-core/scripts \ No newline at end of file
diff --git a/pywikibot-core b/pywikibot-core
-Subproject f1b4b4d0cfbc199c36fb72570425328daa93b06
+Subproject 71e1ef3161cc025d60869e3ff6d90d77dced0c6
diff --git a/user-config.py b/user-config.py
index fd59df8..768ef0b 100644
--- a/user-config.py
+++ b/user-config.py
@@ -1,8 +1,6 @@
-import os, sys
-sys.path.insert(0, os.getcwd()+"/pywb/python-import-path")
+import os
console_encoding = 'utf-8'
user_families_paths = [ 'pywb/families' ]
-user_script_paths = [ 'pywikibot-core/scripts' ]
password_file = "user-password.cfg"
mylang = 'en'
family = 'ArchiveTeam'