[Distutils] Version number required for setup?

Thomas Heller thomas.heller@ion-tof.com
Tue Nov 20 02:41:01 2001


distutils/command/dist.py contains this code

    # -- Metadata query methods ----------------------------------------
    ...
    def get_version(self):
        return self.version or "???"

which returns '???' as a version number if none is specified
in the setup script.

Since the bdist commands construct a filename containing the version
number this leads to an invalid filename under windows, and the builds
fail with a traceback like this:

    zip -rq D:\workspace\projects\epos\bin\dist\startup-???.win32.zip .
    creating 'D:\workspace\projects\epos\bin\dist\startup-???.win32.zip'
    and adding '.' to it
    error: D:\workspace\projects\epos\bin\dist\startup-???.win32.zip:
    Invalid argument


The fix for bug #409403 (Signal an error if the distribution's metadata
has no version) fixed this behaviour by requiring a version number:

         if self.metadata.version is None:
              raise DistutilsSetupError, \
                    "No version number specified for distribution"

In the meantime, version 1.47 of dist.py, this code has been removed again.
Log message: "Back out the requirement to supply a version number".
Why was this done?

I do not know whether we should require a version number or not, but at
least the "???" string literal should be changed to something which can
be part of a valid filename under windows (although IMO 'UNKNOWN' isn't
really a better version number than '???')...

Thomas