[openstack-dev] [tc][pbr][packaging][all] Definition of Data Files (config) in setup.cfg

Thomas Goirand zigo at debian.org
Sat Jun 11 23:31:56 UTC 2016

On 06/11/2016 05:02 AM, Robert Collins wrote:
> The underlying problem is as you say that distutils and setuptools and
> wheel are all different, and until there is a PEP addressing this
> *and* implemented in both wheel and setuptools, we won't get
> consistent behaviour. I'm pretty sure Daniel Hoth is interested in
> making this happen - there have been threads about it on distutils-sig
> inside the last year, but we (me/sachi/steven) hadn't gotten onto it
> as a thing to help with. I suggest chatting to Daniel as a first point
> of call to see where his effort is at and what help is needed.
> Note that we *need* the wheel and setuptools behaviour to be
> consistent, or we will have differences between distro package
> building, devstack, and ansible uses.. amongst others.
> -Rob

=== A bit of context for everyone to understand ===
Just so that everyone understands and gets the context. If in a
setup.cfg managed by PBR, we have something like this:

data_files =
    etc/keystone/keystone.conf = etc/keystone.conf.sample

Then keystone.conf ends up installed in /usr/etc/keystone when setup.py
install is used. With this configuration, it would be installed
correctly within a venv.

If instead we have:
data_files =
    /etc/keystone/keystone.conf = etc/keystone.conf.sample

[ notice the leading / for the destination... ]

Then keystone.conf gets installed on the root of the filesystem instead
of properly be installed within the venv. Though it's installed properly
for distributions in /etc/keystone.

To address this problem, Julien Danjou attempted to add a --sysconfdir
option in PBR. Though it was rejected by Robert, who wrote in the code
review that it should be addressed within setuptools or disutils.

If I got the above facts wrong, feel free to let everyone know. Now, my
reply to Robert...
=== End of context ===


I do not agree that we *must* wait until politics are discussed and a
consensus appears within the upstream python distutils / setuptools
folks. The issue we're trying to address here is annoying everyone, both
upstream using venv, and downstream package maintainers. The
--sysconfdir option that we've tried to add to PBR would be a very
pragmatic answer to the issue that would effectively be the end to this

I do agree though that it'd be nicer if things were to be addressed
within setuptools directly. But this can be done later. In the mean
while, each and every downstream distributions (which means at least 5
distros currently) have to fix the non-sense of config files installed
within /usr/etc.

I also would like to point out that it isn't a good idea for upstream
authors to double-guess what downstream package maintainers are
expecting. For example in Debian, "foo" service to ships its
configuration files within /usr/share/foo/foo.conf, and copies it in the
postinst to /etc/foo/foo.conf, so that it can be owned by the "foo"
system user. So if PBR+setuptools are automatically installing stuff for
me in /etc/foo, I would also need to work this around. So a new option
--no-config-file-install" would be useful for me. I'd happily add it to
PBR, though I'm afraid that you, Robert, will veto it, and that my patch
wont ever be merged. I'm busy with 380+ packages for OpenStack, and
don't want to waste too much time, so your view here would be useful
before I invest some time on this patch.

Thoughts anyone?


Thomas Goirand (zigo)

More information about the OpenStack-dev mailing list