[pitivi] flatpak: Install also pylint for development
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] flatpak: Install also pylint for development
- Date: Wed, 7 Feb 2018 09:32:41 +0000 (UTC)
commit ed407bcc36c503f490b770f0061e8f3fd32317e1
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Wed Feb 7 10:30:36 2018 +0100
flatpak: Install also pylint for development
build/flatpak/pitivi-flatpak | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/build/flatpak/pitivi-flatpak b/build/flatpak/pitivi-flatpak
index c93aa26..cd7bbe2 100755
--- a/build/flatpak/pitivi-flatpak
+++ b/build/flatpak/pitivi-flatpak
@@ -545,11 +545,11 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
venv_path = os.path.join(self.scriptdir, "pyvenv")
activate_script = os.path.join(venv_path, "bin", "activate")
- pip_modules = "git-phab pre-commit git-pylint-commit-hook git_pep8_commit_hook"
+ pip_modules = "git-phab pre-commit git-pylint-commit-hook git_pep8_commit_hook pylint"
if not os.path.isdir(venv_path):
- print("Setting up a Python virtual env: %s" % venv_path)
+ print("Setting up a Python virtual env for development: %s" % venv_path)
venv.create(venv_path, with_pip=True)
- print("Installing development tools in a Python virtual env: %s" % venv_path)
+ print("Installing development tools in the Python virtual env: %s" % pip_modules)
subprocess.check_call(
". %s && pip install %s" % (activate_script, pip_modules),
shell=True)
@@ -559,6 +559,15 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
". %s && pip install -U %s" % (activate_script, pip_modules),
shell=True)
+ # git-pylint-commit-hook must run pylint in the sandbox so it uses
+ # the gi Python modules in there. At the same time it also has to be
+ # installed in the development pyvenv which is outside the sandbox
+ # because git-pylint-commit-hook needs to import pylint.config.
+ if fresh_install or self.update:
+ pip_modules = "pylint"
+ print("Installing development tools in the sandbox: %s" % pip_modules)
+ self.run_in_sandbox("pip3 install -U --user %s" % pip_modules, exit_on_failure=True)
+
if not self.check and not self.update:
self.run_in_sandbox(*self.args, exit_on_failure=True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]