I am currently trying to generate sphinx documentation for scripts which use the ArcGIS arcpy library.
I am running into an issue when sphinx tries to run the scrip
If your project is importing sphinx (in my case a sphinx extension), the following may also work for you
import os
import sys
if os.path.basename(sys.argv[0]) == "sphinx-build":
# code for when sphinx is running
else:
# code for regular application
I'm not sure if that will work on Windows or if it should be something like
if os.path.basename(sys.argv[0]) in ["sphinx-build", "sphinx-build.exe"]: