[qmtest] [b,s]dist creation

Mark Mitchell mark at codesourcery.com
Sat Sep 6 01:59:43 UTC 2003


On Tue, 2003-09-02 at 21:01, Stefan Seefeld wrote:
> hi there,
> 
> attached is a patch that factors commands out of the setup.py
> file and stores them into 'qmdist/commands/'. This is mostly
> in preparation for more command fine-tuning, which may require
> standard commands such as 'bdist_rpm' to be extended for qmtest,
> as well as new packages such as 'check' to be added.

I finally got a chance to review this.

This is very cool.

A few notes:

#1: I happened to have a bunch of extra stuff lying around in "scripts"
when I ran "python2 setup.py sdist".  That all got put into the dist
file.  I think we need to refine MANIFEST.in somewhat to be less
all-inclusive.  The other possibility is to check out pristine versions
of QMTest before building packages (which is what the current release
script does).  That's OK, too.  What do you think?

#2: To correct the above, I removed the stuff in scripts, but it still
tried to use it.  I had to manually remove MANIFEST to get it to rebuild
correctly.  Perhaps we need to automate this process using the Makefile
or more magic in the distutils work you've done.  Or maybe we just need
to have good directions about how to do stuff and/or update the
scripts/qm-release.

#3: bdist_rpm didn't work for me:

rpm -ba --define _topdir
/home/mitchell/dev/qm-mainline/build/bdist.linux-i686/rpm --clean
build/bdist.linux-i686/rpm/SPECS/qm.spec

On Red Hat 8.0, you have to say "rpmbuild -ba".  The current release
script uses "rpmbuild" everywhere, because we generally don't build for
older versions of GNU/Linux.  How do we change this bit?

#4. bdist_wininst is extremely cool.  Very, very cool.  However, here's
the downside: after installation, I couldn't run QMTest. :-(

Here's the error:
  
Traceback (most recent call last):
  File "c:\Python22\scripts\qmtest.py", line 39, in ?
    import qm
  File "C:\Python22\Lib\site-packages\qm\__init__.py", line 36, in ?
    from qm.diagnostic import error, warning, message
  File "C:\Python22\Lib\site-packages\qm\diagnostic.py", line 212, in ?
    __initialize_module()
  File "C:\Python22\Lib\site-packages\qm\diagnostic.py", line 205, in __initialize_module
    diagnostic_set.ReadFromFile(diagnostic_file)
  File "C:\Python22\Lib\site-packages\qm\diagnostic.py", line 83, in ReadFromFile
    file = open(path, "r")
IOError: [Errno 2] No such file or directory: 'build\x08dist.win32\\wininst\\DATA\\share\\qm\\diagnostics\\common.txt'

What's up with that, do you think?

The manual will also need updating if we do this, because the installed
QMTest is in a different place than it used to be.  (It put it in
c:\Python22\Scripts\qmtest.py.)

#5: I'm a little nervous about relying on a largely unsupported Python
component, i.e., distutils.  I *want* to rely on it, because this stuff
seems much more automated and more likely to work well with Python and
it's much more automated.  However, I'm pretty sure Bourne shell scripts
and Makefiles will always work; I'd hate to find out that Python 2.8 had
a totally busted distutils.  Convince me that ain't going to happen. :-)

Coding nits:

- We leave two lines between functions.  Some of the stuff in qmdist
only has one line of spacing.

- There should be:

########################################################################
# Imports
#######################################################################

and other similar blocks in the new qmdist files.  (Look at, say,
executable.py for good examples.)

- The MANIFEST.in comments should be full sentences.

-- 
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com




More information about the qmtest mailing list