Hi,
I just pulled the latest pwb from upstream and this commit is giving me some headakes. The associated bug says "Add script integration tests", and the description says "Miscellaneous pwb improvements".
However, when running with python 2.7.8, all I get is a bunch of warnings (see below). Have you guys tested this with python 2? Have you considered that some users might not use folders as modules, but rather have related scripts in the same folder?
Thanks, Strainu
Parent module monumente not found: No module named monumente ./monumente/parse_monument_article.py:10: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import sys ./monumente/parse_monument_article.py:11: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import time, datetime ./monumente/parse_monument_article.py:12: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import warnings ./monumente/parse_monument_article.py:13: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import json ./monumente/parse_monument_article.py:14: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import string ./monumente/parse_monument_article.py:15: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import cProfile ./monumente/parse_monument_article.py:16: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import re ./monumente/parse_monument_article.py:18: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import pywikibot ./monumente/parse_monument_article.py:19: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import pagegenerators ./monumente/parse_monument_article.py:20: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import config as user ./monumente/parse_monument_article.py:21: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import catlib ./monumente/parse_monument_article.py:24: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import strainu_functions as strainu
HI Strainu,
I am guessing you're using $ python pwb.py <script name>
Are you placing your scripts in the same directory as 'pwb.py'? I dont think I've recently tested that.
We do regularly test pwb.py on python 2 with scripts either in the 'scripts' directory, or in any another subdirectory. Both should work, however if you use a directory other than 'scripts', you will need to use:
$ python pwb.py directory/<script name>
We could add a little code to find the script in any subdirectory without specifying the directory name, if that is useful.
On Fri, Jan 23, 2015 at 8:32 PM, Strainu strainu10@gmail.com wrote:
Hi,
I just pulled the latest pwb from upstream and this commit is giving me some headakes. The associated bug says "Add script integration tests", and the description says "Miscellaneous pwb improvements".
However, when running with python 2.7.8, all I get is a bunch of warnings (see below). Have you guys tested this with python 2? Have you considered that some users might not use folders as modules, but rather have related scripts in the same folder?
Thanks, Strainu
Parent module monumente not found: No module named monumente ./monumente/parse_monument_article.py:10: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import sys ./monumente/parse_monument_article.py:11: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import time, datetime ./monumente/parse_monument_article.py:12: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import warnings ./monumente/parse_monument_article.py:13: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import json ./monumente/parse_monument_article.py:14: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import string ./monumente/parse_monument_article.py:15: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import cProfile ./monumente/parse_monument_article.py:16: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import re ./monumente/parse_monument_article.py:18: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import pywikibot ./monumente/parse_monument_article.py:19: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import pagegenerators ./monumente/parse_monument_article.py:20: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import config as user ./monumente/parse_monument_article.py:21: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import catlib ./monumente/parse_monument_article.py:24: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import strainu_functions as strainu
2015-01-23 17:10 GMT+02:00 John Mark Vandenberg jayvdb@gmail.com:
HI Strainu,
I am guessing you're using $ python pwb.py <script name>
Are you placing your scripts in the same directory as 'pwb.py'? I dont think I've recently tested that.
We do regularly test pwb.py on python 2 with scripts either in the 'scripts' directory, or in any another subdirectory. Both should work, however if you use a directory other than 'scripts', you will need to use:
$ python pwb.py directory/<script name>
Hi,
This is how I'm using pwb. "directory" is just that - a place to shove related scripts, not a proper python package (no __init__.py ). This worked until today's pull.
However, your change treats any subfolder as a package, by trying to load "directory.script_name"; this seems to me like a far-fetched assumption.
We could add a little code to find the script in any subdirectory without specifying the directory name, if that is useful.
That sounds like a good middle-ground, as it brings back some of the simplicity pwb had a few years back.
If you guys want to transform pwb into a proper python package that follows all the language's guidlines, great, but please try to keep the default usage as simple and straightforward as possible - many of pwb's users are not programmers or simply don't care to upgrade their scripts to the same level of complexity the framework now has.
Also, making the relation between commits and tracker items would greatly help debugging. It's still unclear to me why this change was needed for that particulat bug.
Thanks, Strainu
On Fri, Jan 23, 2015 at 8:32 PM, Strainu strainu10@gmail.com wrote:
Hi,
I just pulled the latest pwb from upstream and this commit is giving me some headakes. The associated bug says "Add script integration tests", and the description says "Miscellaneous pwb improvements".
However, when running with python 2.7.8, all I get is a bunch of warnings (see below). Have you guys tested this with python 2? Have you considered that some users might not use folders as modules, but rather have related scripts in the same folder?
Thanks, Strainu
Parent module monumente not found: No module named monumente ./monumente/parse_monument_article.py:10: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import sys ./monumente/parse_monument_article.py:11: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import time, datetime ./monumente/parse_monument_article.py:12: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import warnings ./monumente/parse_monument_article.py:13: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import json ./monumente/parse_monument_article.py:14: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import string ./monumente/parse_monument_article.py:15: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import cProfile ./monumente/parse_monument_article.py:16: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import re ./monumente/parse_monument_article.py:18: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import pywikibot ./monumente/parse_monument_article.py:19: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import pagegenerators ./monumente/parse_monument_article.py:20: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import config as user ./monumente/parse_monument_article.py:21: RuntimeWarning: Parent module 'monumente' not found while handling absolute import from pywikibot import catlib ./monumente/parse_monument_article.py:24: RuntimeWarning: Parent module 'monumente' not found while handling absolute import import strainu_functions as strainu
-- John Vandenberg