You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an entry point in my project_root/scripts however what that script is doing is running a subprocess to run the script with the correct python interpreter and its dependencies like:
project_root/scripts/my-cli.py
def main():
# Determine the base path at runtime
this_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.join(this_path, '..')
# Locate the Python interpreter in the bundled venv
venv_python = os.path.join(root_path, 'build_venv/bin/python3')
# Path to main script
main_script = os.path.join(root_path, 'entrypoint.py')
# Check if the bundled interpreter exists
if not os.path.exists(venv_python):
print("Python interpreter not found. Please create it.")
sys.exit(1)
# Run the main script with the bundled interpreter
command = [venv_python, main_script] + sys.argv[1:]
result = subprocess.run(command)
return result.returncode
if I place the # PYTHON_ARGCOMPLETE_OK in the project_root/scripts/my-cli.py then the completion is not working
however if i place it on the entrypoint.py that is called by the subprocess here above then it works perfectly
obviously I cannot call entrypoint.py directly from my zsh because I don't always have the correct venv activated.
Is there a work around for this to work?
The text was updated successfully, but these errors were encountered:
I have an entry point in my
project_root/scripts
however what that script is doing is running a subprocess to run the script with the correct python interpreter and its dependencies like:project_root/scripts/my-cli.py
if I place the
# PYTHON_ARGCOMPLETE_OK
in theproject_root/scripts/my-cli.py
then the completion is not workinghowever if i place it on the
entrypoint.py
that is called by thesubprocess
here above then it works perfectlyobviously I cannot call
entrypoint.py
directly from myzsh
because I don't always have the correctvenv
activated.Is there a work around for this to work?
The text was updated successfully, but these errors were encountered: