Hi list,

the import of setuptools in cx_Freeze/dist.py breaks options of
setup.py commands.


Steps to reproduce
------------------

Create a module 'test.py':
        ------------------------------
        class testclass:
            pass

        def testfunc():
            pass
        ------------------------------

Create 'setup.py':
        ------------------------------
        import cx_Freeze

        cx_Freeze.setup(name='test',
                        version='1.0',
                        author = "me",
                        author_email = "None",
                        url = "None",
                        py_modules=['test'])
        ------------------------------

Run
        $ python3 setup.py sdist --force-manifest


Actual behaviour
----------------

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --force-manifest not recognized


Expected behaviour
------------------

The script should run as if distutils.core had been imported instead of
cx_Freeze, i.e. transparently handle the case without an error:

running sdist
running check
warning: sdist: manifest template 'MANIFEST.in' does not exist (using
default file list)

warning: sdist: standard file not found: should have one of README,
README.txt

writing manifest file 'MANIFEST'
creating test-1.0
making hard links in test-1.0...
hard linking setup.py -> test-1.0
hard linking test.py -> test-1.0
Creating tar archive
removing 'test-1.0' (and everything under it)


Cause
-----

The import of setuptools in cx_Freeze/dist.py somehow changes the
internals of distutils commands:

dist.py:
        ------------------------------
        try:
            import setuptools
        except ImportError:
            pass
        ------------------------------


Temporary fix
-------------

Commenting the lines above, i.e.preventing the setuptools import, fixes
the problem. setup.py runs as expected now.

This should probably be replaced by a conditional import of
setuptools where it is required.


Versions affected
-----------------

Tested:

Python 3.1.2 (Linux, win32)
cx_Freeze 4.1.2
cx_Freeze 4.2.1


Regards,
        Florian

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to