Using distutils 2.4 for python 2.3

N

Noam Raphael

Hello,

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 ?

Thanks,
Noam Raphael
 
G

George Sakkis

Noam Raphael said:
Hello,

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 ?

Thanks,
Noam Raphael

You could distribute the whole 2.4 distutils package in yours so that setup.py finds it before the
default one. If distutils 2.4 is compatible with 2.3, that should work.

George
 
F

Fredrik Lundh

Noam said:
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>
 
N

Noam Raphael

Fredrik said:
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>

I tried this, but it made python2.4 behave like python2.3, and not
install the package_data files.

Did I do something wrong?
 
J

John J. Lee

Noam Raphael said:
I tried this, but it made python2.4 behave like python2.3, and not
install the package_data files.

Did I do something wrong?

I'm *guessing* should have been something like (untested):

from distutils.dist import DistributionMetadata
try:
DistributionMetadata.classifiers
except AttributeError:
DistributionMetadata.classifiers = None

setup(
...
classifiers=...
)


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,323
Members
48,005
Latest member
ChasityFan

Latest Threads

Top