Workaround for pip failure to perform editable install with `--user`
#
import os
+import site
import subprocess
import sys
from distutils.cmd import Command
@@ -30,6 +31,10 @@ from setuptools.command.develop import develop
from setuptools.command.sdist import sdist
from wheel.bdist_wheel import bdist_wheel
+# Enables --editable install with --user
+# https://github.com/pypa/pip/issues/7953
+site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
+
repo_root = os.path.dirname(os.path.abspath(__file__))
