I want to create setup.py that installs my files in user directories. I have a specific prefix where I would like to get the following result:
/my/prefix/ bin/ script.sh libexec/ one.py two.py ... lib/pythonX.Y/site-packages/ package/...
My initial design is as follows:
/ script.sh one.py two.py ... setup.py package/... __init__.py ...
What would be the best way to achieve this? I would like to be able to install it later with something like:
python setup.py install
I can get a "package" installed perfectly in the correct directory, since lib / pythonX.Y / site-packages in the -prefix section is the default location. But is there a clean way to get script.sh in "bin" and other python files in "libexec"? The only way to achieve this is to manually copy these files into my setup.py script. Maybe there is a cleaner and more standard way to do this?
(edit)
Decision
I ended up with setup.py like this:
setup(name='mylib', scripts=['script.sh'], data_files=[('libexec', ['one.py', 'two.py'])] )
Of course, you can iterate over all python files for libexec, but I only have 2-3 python files that I need.
(edit2)
Alternatively, I can have setup.cfg with the following:
[install] prefix=/my/prefix
and instead of python setup.py install --prefix=/my/prefix I can just do:
python setup.py install
python installation setup.py configuration
Ago May 5 '12 at 1:57 2012-05-05 01:57
source share