Issue258

Title site-packages warning
Priority bug Status chatting
Superseder Nosy List kayhayen, marc.jofre
Assigned To kayhayen Keywords

Created on 2015-10-25.16:43:00 by marc.jofre, last changed by marc.jofre.

Messages
msg1782 (view) Author: marc.jofre Date: 2016-01-16.17:50:07
Hi Kay,

I agree to have available compatibility for:
try:
   import a
except ImportError
   import b as a

Also, compatibility foor pre-loading a python method as.

MODULEMETHOD=module.method()

MODULEMETHOD

Best,

Marc
msg1665 (view) Author: kayhayen Date: 2015-10-26.07:28:53
These warnings are supposed to inform users about missing imports that Nuitka failed to 
resolve.

For site packages this is pretty normal to happen, and somebody else his responsibility.

I see multiple ways forward:

a) We ask all upstreams of the world to annotate with PyLint exceptions the imports that 
fail and that is being acceptable.

b) Likely all of these are inside something that handles "ImportError" or in dead code 
inside of branches of the more or less static "os.name" or "sys.version" checks variety.

c) Since Nuitka is going to turn these into "raise ImportError("Cannot import...") for at 
least standalone mode, these are noteworthy to the user.

d) For site packages as opposed to application code, we just don't warn about these.

e) Move this into an optional report with links annotated to source code.

To me, detecting if a specific exception is being caught locally, seems like the most 
worthwhile goal in terms of optimization.

try:
   import a
except ImportError
   import b as a

This pattern for instance should be detectable. Due to exception handlers being deeply 
rewritten into branches, it's not easy, but it feels like a next big step for code 
analysis.

Right now, I think I am going to do d) now, as nobody anybody ever has looked at this 
code and done anything about it, or so I suspect. And put "b" as a higher priority.

Having this kind of code be optimized (away):

if os.name == "nt":
   import wintypes

needs program analysis on imports, and an option to close down on imports.

Currently I am closing down on existing technical debts, then function inlining changes, 
and then this, since it's going to make a rather large cut on program sizes.

I figure I should create issues for all these things. Later today.

Yours,
Kay
msg1656 (view) Author: marc.jofre Date: 2015-10-25.16:43:00
Hi all,

A whole list of warnings is dumped on the command line, shown below. How do I 
indicate nuitka that the folder and all subfolders to be included in the search 
path?


D:\SixSensoCompilation\cytometer\ExeWebBased64bits\RPCconnectCYT.build>nuitka --
exe --standalone --file-reference-choice=original --output-dir=D:/SixSensoCompil
ation/cytometer/ExeWebBased64bits/ --recurse-all --recurse-to=multiprocessing --
plugin-enable=multiprocessing --recurse-not-to=PySide --icon=D:/productgeneraldi
stributables/softwaregeneralscripts/PythonGeneralController/SIXSENSOLogoRGBicon.
ico D:/productgeneraldistributables/backend/Backend_GUI/mysite/mysite/RPCconnect
CYT.py
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\o
penpyxl\reader\excel.py:18: Cannot find 'tests' in package 'openpyxl' 2 package
levels up.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\j
dcal.py:453: Cannot find 'pyslalib' as relative or absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\o
penpyxl\drawing\drawing.py:422: Cannot find 'Image' in package 'openpyxl.drawing
' as absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\P
IL\GifImagePlugin.py:213: Cannot find '_imaging_gif' in package 'PIL' as relativ
e or absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\p
ycparser\ply\yacc.py:108: Cannot find 'ply.lex' in package 'pycparser.ply' as re
lative or absolute import.
Nuitka:WARNING:D:\productgeneraldistributables\softwaregeneralscripts\PythonAlgP
roc\ImageHandling.py:20: Cannot find 'skimage.restoration' as relative or absolu
te import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\n
ose\suite.py:22: Cannot find 'clr' in package 'nose' as relative or absolute imp
ort.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\n
ose\suite.py:24: Cannot find 'IronPython.Runtime.Exceptions' in package 'nose' a
s relative or absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\n
ose\plugins\skip.py:22: Cannot find 'unittest2.case' in package 'nose.plugins' a
s relative or absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\p
kg_resources\__init__.py:94: Cannot find 'packaging.version' in package 'pkg_res
ources' as absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\p
kg_resources\__init__.py:95: Cannot find 'packaging.specifiers' in package 'pkg_
resources' as absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\s
cipy\misc\pilutil.py:22: Cannot find 'Image' in package 'scipy.misc' as absolute
 import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\s
cipy\misc\pilutil.py:23: Cannot find 'ImageFilter' in package 'scipy.misc' as ab
solute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\s
cipy\sparse\linalg\dsolve\linsolve.py:14: Cannot find 'scikits.umfpack' in packa
ge 'scipy.sparse.linalg.dsolve' as absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\m
atplotlib\pyplot.py:90: Cannot find 'PyQt5.QtWidgets' in package 'matplotlib' as
 absolute import.
Nuitka:WARNING:D:\WinPython-64bit-2.7.6.3\python-2.7.6.amd64\Lib\site-packages\m
atplotlib\pyplot.py:96: Cannot find 'gobject' in package 'matplotlib' as absolut
e import.
History
Date User Action Args
2016-01-16 17:50:07marc.jofresetmessages: + msg1782
2015-10-26 07:28:53kayhayensetstatus: unread -> chatting
assignedto: kayhayen
messages: + msg1665
nosy: + kayhayen
2015-10-26 06:41:17marc.jofresetpriority: feature -> bug
2015-10-25 16:43:00marc.jofrecreate