0

I have a Python package that includes a shell script. When the shell script is called, it needs to access other files that are part of the installation. I include the script in my setup.py as

scripts=['source_dir/utils/mybashscript'],

The problem now is that it will end up in virtualenv_dir/bin/. What I would want to do is get the absolute path to where the source_dir/utils/ directory ends up after installation from within mybashscript.

Is there a workaround for this?

It's a rather standard python package setup like

mypackage/  
| -- setup.py  
| -- source_dir/  
|      | -- utils/  
|      |       | -mybashscript  
fteufel
  • 59
  • 1
  • 5
  • One question: is `setup.py` in the same directory as `source_dir/utils/mybashscript`, or is it in `source_dir`? Could you provide some information as to where the files are in relation to each other? – Sylvester Kruin Nov 01 '21 at 18:38
  • 1
    It does not seem to have anything to do with Python or Setuptools. You should write the logic to find out the absolute location of the shell script in this same shell script. Maybe this: https://stackoverflow.com/a/246128 – sinoroc Nov 02 '21 at 07:56

0 Answers0