version in setup.cfg

Diez B. Roggisch deets at nospam.web.de
Mon Feb 9 14:59:16 EST 2009


Jasiu schrieb:
> Hi guys,
> 
> I have a question about setup.py and setup.cfg:
> 
> I work in a company and we use Subversion to keep our stuff. We have a
> post-commit rule that does the following: whenever there is a commit
> to /tags/ directory, a binary package is built automatically. The
> tag's name is the new version of the package, i.e. tag names are
> something like /tags/1.5.2, /tags/1.2.3 etc. We use setup.py to create
> packages. In setup.py we set the version of the package by specifying
> 'version' keyword argument to setup function. We have automated builds
> and our post-commit script does kind of ugly regexp hack and replaces
> string "version='...'" with version that is guessed from the tag name.
> And I wonder: It would be much cleaner if the version could be placed
> in the setup.cfg file. Is that possible?

I don't think so. But there are several other options:

  - install pysvn & use that in setup.py to extract the tag from the 
working-copy, making it part of version

  - instead of the dirty hack, use an a little bit less ugly hack to 
write that version to a file in the WC, and open & read that within setup.py

Diez



More information about the Python-list mailing list