I have solved this for publishing GP services by doing this:
Publish a service after supplying an empty string as an input parameter.
Source code for a script tool:
if input_param == "":
#for GP script tool publishing
Result = ""
Result = mainmodule.dowork(input_param)
arcpy.AddMessage("Result: " + Result)
After publishing you will have an empty string as the default value for the parameter. Now you can edit the mainmodule.py and add the logic that will check if the
None and throw any exception.
All my GP services consist of the caller script tool that is used only for publishing (with arcpy params) and another script tool where is the business code. The latter file is not published to server and all updates will be used immediately by the GP service.