sizmailov / pybind11-stubgen

Generate stubs for python modules
Other
238 stars 50 forks source link

Suggestion: Support importing modules from the current directory #77

Closed wallds closed 2 years ago

wallds commented 2 years ago
sys.path.append(os.path.abspath(os.curdir))
sizmailov commented 2 years ago

Hi! I don't think it's a good idea.

Unconditionally adding current directory to sys.path is a no-go since it's likely not desired by most of users. If you suggest to add a command line option, I don't see how it's better than setting PYTHONPATH from shell or calling sys.path.append if used directly from python.

wallds commented 2 years ago

Thank you for your reply and solution.

set PYTHONPATH=.

Tested successfully in windows