I have an ArcGIS geoprocessing service which causes problems when publishing to arcgis server. The python scripts behind the service are structured as a custom python module, in a folder with an 'init.py' file, because the scripts contain many thousands of lines of code and there was a design choice to develop this way. My problem is that the script 'main.py' is published to the server correctly, but all of the other scripts are not. 'main.py' calls all of the other scripts. Therefore when I try to run the service I get ' Import Error - No such module as Scriptsforservice', where main.py is importing.
Is there a way to get arcgis to upload the custom module properly during publishing? I have found a hack which is to copy the module directly into my server's local python libraries, but this is not an acceptable long term solution.