0

Hi Ive been searching around on the interwebs for a while now but cant seem to find anything that covers what Id like using disutils.

Lets say I have a python package dependant on various dependancies. I know I can use a 'setup.py' and 'disutils' to configure what dependancies are needed and have them install using 'easy_install'. Thats great but I would like to have my package extracted into a new 'dir', in lets say '/usr/local/share/', amend the .bashrc to include the relevant path and chmod the the '.py' to allow execution from any command terminal.

Is this even possible using disutils? As already mentioned Ive seen a few options for making packages executable such as using .zip extensions and some command line kungfu (source) but I cant seem to find away to achieve all the above.

I have already looked at this StackOverflow question/answer and it does not fully cover what I am trying to do. It doesnt explain how to extract to a a custom dir location.

Any pointers would be great please.

Community
  • 1
  • 1
iNoob
  • 1,375
  • 3
  • 19
  • 47
  • You can set a `scripts` keyword argument to `setuptools.setup` in your `setup.py` to handle this for you - see e.g. https://github.com/textbook/nr_stomp/blob/master/setup.py#L33 – jonrsharpe Mar 25 '15 at 12:26
  • @jonrsharpe so would I create a script in the 'scripts' argument that executes the changes I am after? cp to desired 'dir', chmod file.py 755 (whatever) and append the relevant changes to the '.bashrc' ? – iNoob Mar 25 '15 at 12:32
  • No, the `scripts` argument is a list of the scripts you want **to be installed for you** for command-line access. If you install `nr_stomp`, for example, it allows you to call `run_client.py create config.cfg` from the command line. Why would you want a custom location? The script can just be a very thin entry point (again, see my example - https://github.com/textbook/nr_stomp/blob/master/scripts/run_client.py) to the package **wherever it gets installed**, you don't need to worry about those details. – jonrsharpe Mar 25 '15 at 12:35

0 Answers0