nansat
nansat copied to clipboard
setup.py and perl scripts in mapper_ncep_wind_online.py
This is related to a comment in #87. There seems to be a problem with installing the perl scripts used for mapper_ncep_wind_online.py
with python setup.py install
. The scripts are copied to the right folder in site-packages but are not executable and therefore fails. So...
1: Is there a way to make them executable by adding som lines to setup.py
, or...
2: Do we have to make python methods, e.g., in the mapper?
These Perl-scripts are stored in the same folder as the mappers, and thus do not need to be "installed"? In my case they are already executable (-rwxrwxr-x).
These two Perl-scripts are obtained from NOAA for subsetting of Grib-files. Ideally they should be re-written to Python for consistency, but that would take some effort by someone.
Yes, the scripts seem to work when nansat is installed as python build_ext --inplace
but with the regular python setup.py install
the mapper fails because the perl scripts (now in the nansat version in site-packages) aren't executable. I hope the first option above is possible without too much "hacking"...
Ok, I see.
I have minimal experience with setup.py install
, but assume it should be possible to make these scripts executable, or/and place them in the same folder as the mappers (from which they are called).
If not, this should encourage re-writing them to Python.
May 'Replacing Older Functions with the subprocess Module' help? https://docs.python.org/2/library/subprocess.html#subprocess-replacements
@knutfrode , can you test if you can use subprocess
instead of os.system()? maybe that will help to solve the issue?
@akorosov That wouldn't change anything. Please have a look around if with setuptools you can make files executable on install. The long-term and cross-platform solution would be to rewrite the perl scripts in pure Python and don't use any system calls to linux tools.