|
@@ -17,17 +17,10 @@ for python >= 3.7, see:
|
|
class PluginImpl(plugins.python.PythonPlugin):
|
|
class PluginImpl(plugins.python.PythonPlugin):
|
|
def get_build_commands(self) -> List[str]:
|
|
def get_build_commands(self) -> List[str]:
|
|
cmds = super().get_build_commands()
|
|
cmds = super().get_build_commands()
|
|
- # cmds.insert(1, 'python3 -m pip install --upgrade pip');
|
|
|
|
- # cmds.insert(2, 'python3 -m pip install -U "setuptools<58"')
|
|
|
|
- #cmds.insert(1, 'pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip')
|
|
|
|
for idx, cmd in enumerate(cmds):
|
|
for idx, cmd in enumerate(cmds):
|
|
- if cmd.strip().startswith('pip install -c'):
|
|
|
|
|
|
+ if cmd.strip().startswith('pip install -c') and "requirements_all" in cmd:
|
|
cmds[idx] = f"{cmd.strip()} --use-deprecated=legacy-resolver"
|
|
cmds[idx] = f"{cmd.strip()} --use-deprecated=legacy-resolver"
|
|
- # Find position where to inject pip uninstall
|
|
|
|
- # if cmd.strip().startswith('[ -f setup.py ]'):
|
|
|
|
- # xcmds = cmd.split("&&", 1)
|
|
|
|
- # # Inject and force removal
|
|
|
|
- # # cmds[idx] = f"{xcmds[0]} && pip uninstall -y typing uuid && {xcmds[1]}"
|
|
|
|
- # cmds[idx] = f"{xcmds[0]} && pip uninstall -y typing uuid && {xcmds[1]}"
|
|
|
|
- # print(cmds)
|
|
|
|
|
|
+ elif "[ -f setup.py ]" in cmd:
|
|
|
|
+ # Use cfg instead of py
|
|
|
|
+ cmds[idx] = cmd.replace('[ -f setup.py ]', '"${SNAPCRAFT_PYTHON_INTERPRETER}" -m build')
|
|
return cmds
|
|
return cmds
|