setting the right owner of local subdirectories

Hi,
Under Unix-alikes, you have to be root (thus using "sudo" or "su") in order to truly install a package (even with the "develop" command since it copies some info into the system directories).
But an annoying side-effect is that, when you first run "sudo python setup.py develop" (or "install"), it also creates directories in the local directory under the root user.
Which means that, when you later run commands that don't need to be root to be issued, you get the following kinds of error:
$ ./setup.py test running test running egg_info writing flapflap.egg-info/PKG-INFO writing top-level names to flapflap.egg-info/top_level.txt writing dependency_links to flapflap.egg-info/dependency_links.txt writing entry points to flapflap.egg-info/entry_points.txt error: flapflap.egg-info/entry_points.txt: Permission denied
It is a minor but repetitive annoyance. It would be nicer if, when creating those local subdirectories, setup.py would try to change the owner to the owner of the current parent directory (the project base directory).
Regards
Antoine.

Antoine Pitrou antoine.pitrou@wengo.fr writes:
But an annoying side-effect is that, when you first run "sudo python setup.py develop" (or "install"), it also creates directories in the local directory under the root user.
You can configure sudo to set HOME to the home directory of the target user. To do this every time the target is 'root', edit sudoers and add this line:
Defaults>root always_set_home
Read the sudoers(5) man page for more.

Le mercredi 25 octobre 2006 à 22:05 +1000, Ben Finney a écrit :
Antoine Pitrou antoine.pitrou@wengo.fr writes:
But an annoying side-effect is that, when you first run "sudo python setup.py develop" (or "install"), it also creates directories in the local directory under the root user.
You can configure sudo to set HOME to the home directory of the target user. To do this every time the target is 'root', edit sudoers and add this line:
Sorry, my wording was misleading. I meant that setuptools creates subdirectories inside the local project directory (which is fine), and if it was invoked with "sudo" those subdirectories are owned by the root user (which is less fine).

Oops, forgot to copy the list again.
On Wed, 2006-10-25 at 12:28 +0200, Antoine Pitrou wrote:
Under Unix-alikes, you have to be root (thus using "sudo" or "su") in order to truly install a package (even with the "develop" command since it copies some info into the system directories).
But an annoying side-effect is that, when you first run "sudo python setup.py develop" (or "install"), it also creates directories in the local directory under the root user.
Which means that, when you later run commands that don't need to be root to be issued, you get the following kinds of error:
$ ./setup.py test running test running egg_info writing flapflap.egg-info/PKG-INFO writing top-level names to flapflap.egg-info/top_level.txt writing dependency_links to flapflap.egg-info/dependency_links.txt writing entry points to flapflap.egg-info/entry_points.txt error: flapflap.egg-info/entry_points.txt: Permission denied
It is a minor but repetitive annoyance. It would be nicer if, when creating those local subdirectories, setup.py would try to change the owner to the owner of the current parent directory (the project base directory).
With "make" you normally use two commands to separate the build from the install: $ make $ sudo make install
With setuptools the working combination seems to be:
$ ./setup.py egg_info $ sudo ./setup.py develop
Or: $ ./setup.py bdist_egg $ sudo ./setup.py install
I wouldn't mind seeing setuptools be smarter about this, but those workarounds have done the trick for me.
-- Matt Good
participants (3)
-
Antoine Pitrou
-
Ben Finney
-
Matt Good