[00:00:24] @bd808 [00:00:24] I'm following this one atm [00:00:26] https://wikitech.wikimedia.org/wiki/Help:Toolforge/Running_Pywikibot_scripts_(advanced) [00:00:27] [00:00:29] But is it normal that pwb_venv.sh file clones its content after I run ``` [00:00:30] tools.TOOLNAME@tools-sgebastion-10:~$ toolforge-jobs run setup-venv --command $HOME/pwb_venv.sh --image python3.11 --wait [00:00:32] ``` [00:00:33] [00:00:35] Right now the file has 158 lines [00:03:02] @A: That command should execute your pwb_venv.sh script on a Kubernetes exec node. I don't understand what "clones its content" means? Running the script adds more lines to the script? [00:03:37] Yes, it copies the same content over and over. (re @wmtelegram_bot: @A: That command should execute your pwb_venv.sh script on a Kubernetes exec node. I don't understand what "clones its c...) [00:03:42] If you are willing to share your tool name I can take a look at the script and maybe give other advice [00:04:11] sure it's called balyozxanetest [00:07:28] I'm not sure yet what would be making that script append to itself, but I can see that your literally copied the script without any adjustments to actually make it work. Specifically the `pip install ...` line is a placeholder (and maybe we should rip that out of the example?) [00:08:01] * bd808 should run this tutorial in a test tool himself [00:09:08] As soon as I realized pip install .. Is a placeholder, I went to pwb_venv.sh to comment that line but I realized it was appending itself and I tried to delete lines one by one which was unsuccessful [00:10:17] Can you also check setup-venv.out to see why it never finishes installing pywikibot [00:10:29] There is nothing running on the Kubernetes cluster as your tool now, so I'm not sure what would be edit warring with you. [00:13:10] the .out and .err logs look fine to me. they show you ran the job multiple times and that there was ultimately a failure from `pip` because of the `pip install ...` line (ERROR: Invalid requirement: '...') [00:14:50] Could It be because that I started from scratch without deleting existing files multiple times? Should I delete the current files and start again? [00:17:32] @A: if you are not sure what state your files are in, sure. Starting from the start may help you get back on track. [00:19:54] Okay thank you [01:24:29] JJMC89: I can't get `pwb generate_user_files` to work using the tutorial. It crashes for me with "RuntimeError: No user-config.py found in directory '/data/project/bd808-pywikibot'." Same result if I try `pwbvenv/bin/python3 pywikibot-core/pywikibot/scripts/generate_user_files.py`. [01:24:52] I will poke at it tomorrow, but if you know the fix I'd love to hear it. :) [01:26:15] I'll have to look into it - I always manually configure [01:26:28] There is a user-config.py.sample file I removed the sample from it, manually set my user name and it was enough for login.py but I can't make add_text.py work (re @wmtelegram_bot: I will poke at it tomorrow, but if you know the fix I'd love to hear it. :)) [01:28:08] (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ ls [01:28:09] appveyor_install.ps1 dev-requirements.txt LICENSE pywikibot scripts user-config.py.sample [01:28:11] AUTHORS.rst Dockerfile make_dist.py pywikibot.egg-info setup.py user-fixes.py.sample [01:28:12] build Dockerfile-dev MANIFEST.in README.rst tests [01:28:14] CODE_OF_CONDUCT.rst docs mypy.ini requirements.txt tox.ini [01:28:15] CONTENT.rst HISTORY.rst pwb.py ROADMAP.rst user-config.py [01:28:17] (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ nano user-config.py [01:28:18] (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ pwb.py login [01:28:20] bash: pwb.py: command not found [01:28:21] (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ pwb login [01:28:23] fatal: detected dubious ownership in repository at '/data/project/pywikibot/public_html/core_stable' [01:28:24] To add an exception for this directory, call: [01:28:26] [01:28:27] git config --global --add safe.directory /data/project/pywikibot/public_html/core_stable [01:28:29] Password for user Balyozbot on wikipedia:ku (no characters will be shown): [01:28:30] Logged in on wikipedia:ku as Balyozbot. [01:28:32] [01:28:33] Execution time: 20 seconds [01:28:35] (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ pwb add_text -text:"test" -up -always -page:"User:Balyozxane/test" [01:28:36] fatal: detected dubious ownership in repository at '/data/project/pywikibot/public_html/core_stable' [01:28:38] To add an exception for this directory, call: [01:28:39] [01:28:41] git config --global --add safe.directory /data/project/pywikibot/public_html/core_stable [01:28:42] ERROR: add_text.py not found! Misspelling? [01:28:44] (pwbvenv) tools.balyozxanetest@shell-1703207193:~/pywikibot-core$ [01:29:41] @A: please use a pastebin like https://paste.toolforge.org/ to send output samples. The telegram->irc bridge makes a real mess when you just paste big things into a Telegram message. [01:30:02] The shared pywikibot should not be involved in any way. I'd guess you are modifying your PATH or PYTHONPATH somewhere for that to be showing up3 [01:31:35] oh, that might be my problem. I reused an existing tool and it has old PYTHONPATH crap in .bash_profile [01:33:06] JJMC89: bad PYTHONPATH was 100% my problem. Thanks for the prompt [01:35:59] That was actually from @A's fatal. [01:36:09] yeah, but it helped me too :) [06:42:27] Hi, [06:42:27] Is it ok to ask a question re:Pageviews Analysis here? [07:43:52] 2nd attempt :) [07:43:53] I was curious if there are some considerations and arguments behind the lack of the option to define a custom period for topviews? I.e. it is not possible to use the instrument to list the pages with the most views for the last 12 months. You can see the year of 2022, but not the period between Dec 2022 to Nov 2023. Here is the link to the tool: [07:43:53] https://pageviews.wmcloud.org/topviews/?project=en.wikipedia.org&platform=all-access&date=last-month... [13:02:05] I tried following the instructions in Toolforge/Running pywikibot scripts (advanced) but I'm still nowhere. :/ When I run pwb generate_user_files, the script didn't run because of an error and, frankly I didn't want to recreate my user files. Is there a way to copy my existing user files to wherever this process was supposed to recreate them? [13:25:20] Turns out I haven't followed them correctly. Retrying. (re @Klein: I tried following the instructions in Toolforge/Running pywikibot scripts (advanced) but I'm still nowhere. :/ When I run pwb ge...) [13:26:53] if you already have the pywikibot config files, I don't think you would need to re-create them [13:30:41] So I just skip the 5th step in that guide about configuring pywikibot? [13:31:17] try it and see what happens? [13:31:25] I tested the installation like the 6th step says and the output seems like it should be. [13:55:26] I tried running [13:55:27] [13:55:29] Toolforge jobs run myjob - -command "pwbvenv/bin/python3 Smallem-WP.sh" - - image python3.11 [13:55:30] [13:55:32] like the example in that page suggested (removed $HOME as it caused syntax errors). [13:55:33] [13:55:35] The job still fails with an syntax error coming from my script now (Smallem-WP.sh) because it uses "Source $HOME/bash_profile". [13:56:12] I'm not sure why including $HOME causes syntax errors and how to change my script to not use that. [14:39:56] you seem to be trying to run a bash script with a python interpreter. Smallem-WP.sh seem to be a wrapper around a pywikibot script, so you should be able to replace it with a command like the first example in https://wikitech.wikimedia.org/wiki/Help:Toolforge/Running_Pywikibot_scripts_(advanced)#Create_jobs [15:02:35] I will try that and report back the results. Thanks! [16:44:20] Tried it and reported on the Help:Toolforge/Jobs_framework's talk page for transparency. The job fails with this error message: [16:44:20] [16:44:21] ERROR: replace.py not found! Misspelling? [19:38:31] https://wikitech.wikimedia.org/wiki/Help:Toolforge/Running_Pywikibot_scripts_(advanced) [19:38:32] Following this guide but i get an error when using edit, and then when i continue with running the setup script I get  pip not found error. Does anyone have any idea as to why? [19:38:32] tools.balyozbot@tools-sgebastion-10:~$ edit $HOME/pwb_venv.sh [19:38:33] Error: no "edit" mailcap rules found for type "application/x-sh" [19:38:33] Cloning into '/data/project/balyozbot/pywikibot-core/scripts/i18n'... [19:49:13] I've update the doc to not use `edit`. [19:52:21] I don't see any pip error in your logs. [19:56:40] https://paste.toolforge.org/view/dae512c1 [19:56:40] When I send them here i get an error so I pasted the content of setup-venv.err into a pastebin [19:58:39] https://paste.toolforge.org/view/2032961a [19:58:39] this is the content of pwb_venv.sh [20:03:26] Also When i send the pwb_venv.sh via WinSCP i get an error saying "pwb_venv.sh: not found" [20:26:23] You don't need to use "edit" per se but instead edit with a text editor of your choice the script file. [20:26:37] I used vi for example but you can also use nano. [20:27:02] And then copy-paste the content below in that script. [20:28:31] At least that's what I understood and did. I'm saying this because I had the same problem at that step: First time I tried copy-pasting the edit command like it was and I get an error. And basically ended up totally skipping the file creation process. [20:33:40] Did you get pwb_venv.sh not found error as well? I tried this on my test tool yesterday, it was working fine but today im trying to move to antoher tool but i keep getting this error [20:50:31] I think yes. Can't remember perfectly now but I know I got an error which was what made me re-read that whole part. [20:56:47] Appearently my problem was this line: "#!/bin/bash" i didn't write it because it was a "comment" but it worked now. I have no idea pip not found error must be related to this [21:12:02] Glad you could fix it. :) [23:42:07] it's not entirely a comment. https://en.wikipedia.org/wiki/Shebang_%28Unix%29 (re @wmtelegram_bot: Appearently my problem was this line: "#!/bin/bash" i didn't write it because it was a "comment" but it worked now....) [23:58:42] it is a comment, it's just a comment that is interpreted by the shell