Using distutils 2.4 for python 2.3

Fredrik Lundh fredrik at pythonware.com
Fri Sep 23 08:40:47 EDT 2005


Noam Raphael wrote:

> I want to distribute a package. It's compatible with Python 2.3.
> Is there a way to use distutils 2.4 feature package_data, while
> maintaining the distribution compatible with python 2.3 ?

you can enable new metadata fields in older versions by assigning to
the DistributionMetadata structure:

    try:
        from distutils.dist import DistributionMetadata
        DistributionMetadata.package_data = None
    except:
        pass

    setup(
        ...
        package_data=...
    )

</F> 






More information about the Python-list mailing list