[Distutils] setup.py not included in source distribution

Thomas Heller theller@python.net
Thu Nov 7 06:57:01 2002


I came across a strange bug on Win2k, that setup.py
is not included in the distribution by default.

This only occurrs, when the distribution is built by this command line

  setup.py sdist

and not with

  python setup.py sdist

The problem is that in the first case the MANIFEST file contains this line:
  C:\sf\distutils\setup.py
and this line in the second case:
  setup.py

The cause is that in the first case sys.argv[0] is set to
the absolute path 'c:\\sf\\distutils\\setup.py', in the second
case it is 'setup.py'.
Finally, the sdist command copies it's file list in this way:

                dest = os.path.join(base_dir, file)
                self.copy_file(file, dest, link=link)

and os.path.join(xxx, yyy) returns yyy when yyy is an absolute path.

The workaround is simple:
- either use the second form to start the setup script,
- or insert 'setup.py' manually in the MANIFEST.in file.

Sounds like a bug to me, but I'm not sure how to fix it.
Should absolute path names in MANIFEST be allowed or not?

Thomas