Opened at 2009-08-19T13:37:24Z
Closed at 2009-12-13T05:33:10Z
#790 closed defect (fixed)
setup.py thinks it is the previous version
| Reported by: | zooko | Owned by: | warner |
|---|---|---|---|
| Priority: | major | Milestone: | 1.6.0 |
| Component: | packaging | Version: | 1.5.0 |
| Keywords: | Cc: | ||
| Launchpad Bug: |
Description
$ python2.6 ./misc/build-deb.py jaunty
...
copying setup.cfg -> allmydata-tahoe-1.5.0-r4054
Writing allmydata-tahoe-1.5.0-r4054/setup.cfg
creating dist
tar -cf dist/allmydata-tahoe-1.5.0-r4054.tar allmydata-tahoe-1.5.0-r4054
gzip -f9 dist/allmydata-tahoe-1.5.0-r4054.tar
removing 'allmydata-tahoe-1.5.0-r4054' (and everything under it)
/usr/bin/python2.6 setup.py --name
/usr/bin/python2.6 setup.py --name
=> allmydata-tahoe
/usr/bin/python2.6 setup.py --version
=> 1.5.0-r4052
/usr/bin/python2.6 setup.py sdist --formats=gztar
Traceback (most recent call last):
File "./misc/build-deb.py", line 57, in <module>
shutil.copyfile("dist/%s" % TARBALL, "build/debian/%s" % DEBIAN_TARBALL)
File "/usr/lib/python2.6/shutil.py", line 52, in copyfile
fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: 'dist/allmydata-tahoe-1.5.0-r4052.tar.gz'
The problem is that at the time that module-scoped things in setup.py get evaluated, src/allmydata/_version.py contains the version that it was the previous time that setup.py was run. One solution would be to run setup.py twice, e.g. in the build-deb.py script. The first time could just be python ./setup.py darcsver.
Another solution would be to use python ./setup.py darcsver --loud instead of python ./setup.py --version. (This requires darcsver >= 1.3.1 (http://allmydata.org/trac/darcsver/timeline?from=2009-08-19&daysback=90 ).
I can think of other ways to do it, too, but these two seem simplest. Why not use python ./setup.py darcsver --loud instead of python ./setup.py --version?
Change History (2)
comment:1 Changed at 2009-10-26T20:00:04Z by zooko
- Milestone changed from 1.5.1 to 1.6.0
comment:2 Changed at 2009-12-13T05:33:10Z by zooko
- Resolution set to fixed
- Status changed from new to closed

fixed by 9dd27bc7ee098bff