version in setup.cfg

2009-02-09 Thread Jasiu
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?

Thanks,

Mike
--
http://mail.python.org/mailman/listinfo/python-list


Re: version in setup.cfg

2009-02-10 Thread Jasiu
> I don't think so. But there are several other options:

I was afraid of that.

Thanks anyway!

Mike
--
http://mail.python.org/mailman/listinfo/python-list


setup.py install and bdist_egg

2009-03-13 Thread Jasiu
Hey,

I work at a company where I'm lucky enough to write web apps using
Python and WSGI :). We develop more and more stuff in Python and it's
becoming a mess of dependencies, so we thought we would create a
guideline for developers that describes the whole process of deploying
a Python app on a server. Since all of our servers run Debian, all of
our software has to be installed as Debian packages - other
departments that don't use Python (shame on them! :D) already follow
this policy.

Here is what we have figured so far:
1) Write your code.
2) Prepare setup.py, and put names of required eggs in there.
3) Write a Debian wrapper that uses CDBS Python class, and put names
of required Debian packages in there.
4) Build Debian package.
5) Done! Deploy on server and have fun :).

This guideline already works pretty well for us, but I thought I could
tweak it a little. I want to make the Debian package wrapper as thin
as possible so that if we ever stop using Debian, we will still be
able to deploy all of our software as eggs. This goal turned to be
pretty challenging. I have a few questions.

1) Debian has a debian/dirs file where you can list all the
directories that the package should create, for example those in /var/
log, /var/lib . I already figured out that I can use setup.py
'install_data' keyword for that, even for empty directories. Then I
can use 'setup.py install' command and things work great. But... How
about eggs? I'd like my egg to somehow contain or create such
directories. For example, I have a config file that I want to place
in /etc directory. I can do that using 'setup.py install', but
'setup.py bdist_egg' will just create an egg containing etc/
directory. Can I do something about it? Also, why doesn't an egg
contain empty dirs that I place in install_data?

2) What about file permissions? Can they be set by setup.py? My
software runs as www-data user and so /var/log and /var/lib
directories should have proper owner, group and permissions. I didn't
figure out a way to change permissions using setup.py. In Debian I can
use postinst script for that.

If anything sounds unclear, blame my bad english :).

Regards,

Mike
--
http://mail.python.org/mailman/listinfo/python-list