Hi,

I'm trying to debug a complex situazion in which a *nspkg.pth file
creates a builtin package that brakes the import in a uwsgi process.

In this case I'm still working with Python2.7.

To be sure the package is correct I started with an "almost empty" one
(whose content is shown below) and I have this strage behaviour:
if I install using 'python setup.py install' everithing is ok, if I
install with pip the namespace seems a builtin:

   root@argo-stretch:/tmp/jmb.vega# python setup.py install
   ...
   root@argo-stretch:/tmp/jmb.vega# python -c 'import jmb; print(jmb)'
   <module 'jmb' from 
'/usr/local/lib/python2.7/dist-packages/jmb.vega-0.1-py2.7.egg/jmb/__init__.pyc'>

In this case the file 'jmb.vega-0.1-nspkg.pth' is NOT created
and the egg is added to 'easy-install.pth'

When doing the installation with pip

   root@argo-stretch:/tmp/jmb.vega# pip install .
   Processing /tmp/jmb.vega
   Requirement already satisfied: setuptools in 
/usr/lib/python2.7/dist-packages (from jmb.vega==0.1)
   Installing collected packages: jmb.vega
     Running setup.py install for jmb.vega ... done
   Successfully installed jmb.vega-0.1

the file 'jmb.tools-0.7-py2.7-nspkg.pth' is created and the modules
seems a built-in

   root@argo-stretch:/tmp/jmb.vega# (cd ; python -c 'import jmb; print(jmb)')
   <module 'jmb' (built-in)>

In the real case this is enought to break the import system of any
call to namespace 'jmb'.

the test package is

   jmb.vega/
   ├── jmb
   │   ├── __init__.py
   │   └── vega
   │       └── __init__.py
   └── setup.py


sandro@bluff:/tmp/jmb.vega$ cat setup.py
from setuptools import setup, find_packages


setup(
    name='jmb.vega',
    namespace_packages=['jmb'],
    version="0.1",
    description='Test package',
    author='Alessandro Dentella',
    packages=find_packages(exclude=['tests', 'tests.*']),
    platforms='any',
    zip_safe=False,
    install_requires=[
        'setuptools',
    ],
)

While __init__ in jmb is:

sandro@bluff:/tmp/jmb.vega$ cat jmb/__init__.py
__import__('pkg_resources').declare_namespace(__name__)


What's wrong with the configuration?
Why pip makes it a builtin package?

thanks in advance
sandro
*:-)

--
Sandro Dentella  *:-)
http://trepalchi.it                Il portale degli artisti

http://www.reteisi.org             Soluzioni libere per le scuole
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to