[Python-checkins] r77756 - in python/trunk/Lib/distutils: command/bdist_msi.py tests/test_bdist_msi.py

M.-A. Lemburg mal at egenix.com
Tue Jan 26 19:42:43 CET 2010


M.-A. Lemburg wrote:
> Hi Tarek,
> 
> I noticed that you have removed get_platform from the distutils.util
> module. This will break a lot of setup.py code out there.
> 
> Please add a
> 
> 	from sysconfig import get_platform
> 
> to the distutils.util module to restore compatibility.
> 
> Also note that a lot of setup.py code does monkey patching of
> get_platform() to fix certain inefficiencies of its implementation,
> so I'm not sure whether changing the distutils imports to load
> it directly from sysconfig will really do good.

Likewise, distutils.sysconfig's customize_compiler() was moved
to distutils.ccompiler without a b/w compatible import in
sysconfig.

distutils.sysconfig's get_python_inc() is deprecated, but there's
no replacement for it in sysconfig. IMHO, there should be one to
maintain b/w compatibility.

In general, I don't think that we should add lots and lots of
deprecations for moved imports. Just reimport the APIs from the
new locations in the old locations and be done with it.

There's no real benefit from breaking apps in a minor release.
We've been through that and felt the pain with the hash function
reorg - this caused lots of noise without really buying us
anything. Major module reorganization should be left to
major releases.

Thanks.

> tarek.ziade wrote:
>> Author: tarek.ziade
>> Date: Tue Jan 26 18:20:37 2010
>> New Revision: 77756
>>
>> Log:
>> fixed bdist_msi imports and added a test module for distutils.command.bdist_msi
>>
>> Added:
>>    python/trunk/Lib/distutils/tests/test_bdist_msi.py
>> Modified:
>>    python/trunk/Lib/distutils/command/bdist_msi.py
>>
>> Modified: python/trunk/Lib/distutils/command/bdist_msi.py
>> ==============================================================================
>> --- python/trunk/Lib/distutils/command/bdist_msi.py	(original)
>> +++ python/trunk/Lib/distutils/command/bdist_msi.py	Tue Jan 26 18:20:37 2010
>> @@ -6,15 +6,15 @@
>>  """
>>  Implements the bdist_msi command.
>>  """
>> -
>>  import sys, os
>> +from sysconfig import get_python_version, get_platform
>> +
>>  from distutils.core import Command
>>  from distutils.dir_util import remove_tree
>> -from distutils.sysconfig import get_python_version
>>  from distutils.version import StrictVersion
>>  from distutils.errors import DistutilsOptionError
>> -from distutils.util import get_platform
>>  from distutils import log
>> +
>>  import msilib
>>  from msilib import schema, sequence, text
>>  from msilib import Directory, Feature, Dialog, add_data
>>
>> Added: python/trunk/Lib/distutils/tests/test_bdist_msi.py
>> ==============================================================================
>> --- (empty file)
>> +++ python/trunk/Lib/distutils/tests/test_bdist_msi.py	Tue Jan 26 18:20:37 2010
>> @@ -0,0 +1,23 @@
>> +"""Tests for distutils.command.bdist_msi."""
>> +import unittest
>> +import sys
>> +
>> +from distutils.tests import support
>> +
>> + at unittest.skipUnless(sys.platform=="win32", "These tests are only for win32")
>> +class BDistMSITestCase(support.TempdirManager,
>> +                       support.LoggingSilencer,
>> +                       unittest.TestCase):
>> +
>> +    def test_minial(self):
>> +        # minimal test XXX need more tests
>> +        from distutils.command.bdist_msi import bdist_msi
>> +        pkg_pth, dist = self.create_dist()
>> +        cmd = bdist_msi(dist)
>> +        cmd.ensure_finalized()
>> +
>> +def test_suite():
>> +    return unittest.makeSuite(BDistMSITestCase)
>> +
>> +if __name__ == '__main__':
>> +    test_support.run_unittest(test_suite())
>> _______________________________________________
>> Python-checkins mailing list
>> Python-checkins at python.org
>> http://mail.python.org/mailman/listinfo/python-checkins
> 

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 26 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-checkins mailing list