[Spambayes] Alpha2 Pre-release

Richie Hindle richie at entrian.com
Thu Feb 13 21:31:18 EST 2003


[Eric]
> error in spambayes setup command: invalid distribution option 'classifiers'

This looks as though the 2.3 distutils doesn't understand 'classifiers'...
setup.py says:

  # patch distutils if it can't cope with the "classifiers" keyword.
  # this just makes it ignore it.
  if sys.version < '2.2.3':
      from distutils.dist import DistributionMetadata
      DistributionMetadata.classifiers = None

so is this wrong?  I'm no expert with distutils, but I can't see at a quick
glance that it knows about 'classifiers':

  >>> import sys
  >>> sys.version
  '2.3a1 (#38, Dec 31 2002, 17:53:59) [MSC v.1200 32 bit (Intel)]'
  >>> from distutils.dist import DistributionMetadata
  >>> DistributionMetadata.classifiers
  Traceback (most recent call last):
    File "<pyshell#7>", line 1, in ?
      DistributionMetadata.classifiers
  AttributeError: class DistributionMetadata has no attribute 'classifiers'

and:

  C:\Python23\Lib\distutils>grep -i classifiers *.py
  C:\Python23\Lib\distutils>cd command
  C:\Python23\Lib\distutils\command>grep -i classifiers *.py
  C:\Python23\Lib\distutils\command>

Maybe our setup code should say something like [untested]:

  # patch distutils if it can't cope with the "classifiers" keyword.
  # this just makes it ignore it.
  from distutils.dist import DistributionMetadata
  if not hasattr(DistributionMetadata, 'classifiers'):
      DistributionMetadata.classifiers = None

What do people think?  Is there a distutils expert in the house?

> Any insight would be appreciated

You can work around the problem by removing the "classifiers = [ ... ]"
piece of setup.py.  Hope that helps,

-- 
Richie Hindle
richie at entrian.com




More information about the Spambayes mailing list