I am trying to figure out how to properly publish a geoprocessing tool and get it to work when published. The tool works fine in Pro and can be shared out. However, when it is shared it is only copying the .pyt file to the ArcGIS Server and it is not copying any of the required files. I am following the recommended file structure from ESRI's documentation of:
-project
--file.pyt
--file.pyt.xml
--__init__.py
--models
---required.py
---__init__.py
--utils
---utils.py
---__init__.py
However, when sharing as a GP service, nothing in the models or utils directories gets copied over.
What is the suggested best practices for publishing a geoprocessing tool that contains nested python files?
If anyone comes across this issue in the future, here's some of things I've discovered through debugging it:
However, in order to move all files consistently, you must also use the import format of "Import utils." Something like "From utils import logger" will not work.