[pitivi] flatpak: Install git-phab and pre-commit in a virtual env
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] flatpak: Install git-phab and pre-commit in a virtual env
- Date: Thu, 16 Feb 2017 14:39:08 +0000 (UTC)
commit dfafad8a25cb87b931aa7d8517f9c4192c320f06
Author: Thibault Saunier <tsaunier gnome org>
Date: Wed Feb 15 21:58:21 2017 -0300
flatpak: Install git-phab and pre-commit in a virtual env
And activate that env when we setup our dev env
Reviewed-by: Alex Băluț <alexandru balut gmail com>
Differential Revision: https://phabricator.freedesktop.org/D1663
.gitignore | 1 +
bin/pitivi-env | 1 +
build/flatpak/pitivi-flatpak | 15 +++++++++++++++
3 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 86cb2f2..74c3ae7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,4 +25,5 @@ help/index.cache
.bashrc
*.flatpak-builder/
build/flatpak/Pitivi.*.json
+build/flatpak/pyvenv/*
build/devel/
diff --git a/bin/pitivi-env b/bin/pitivi-env
index 78cde0e..2087e81 100755
--- a/bin/pitivi-env
+++ b/bin/pitivi-env
@@ -47,6 +47,7 @@ then
alias pitivi="ptvenv $PITIVI_REPO_DIR/bin/pitivi"
+ source $PITIVI_REPO_DIR/build/flatpak/pyvenv/bin/activate
export PS1="(ptv-flatpak) $PS1"
export PATH="$FLATPAK_ENVPATH/bin/:$PATH"
diff --git a/build/flatpak/pitivi-flatpak b/build/flatpak/pitivi-flatpak
index 278f3ea..8611e36 100755
--- a/build/flatpak/pitivi-flatpak
+++ b/build/flatpak/pitivi-flatpak
@@ -26,6 +26,7 @@ import shutil
import subprocess
import sys
import tempfile
+import venv
from urllib.parse import urlparse
from urllib.request import urlretrieve
@@ -539,6 +540,20 @@ class PitiviFlatpak: # pylint: disable=too-many-instance-attributes
else:
Console.message("Using Pitivi prefix in %s", self.prefix)
+ venv_path = os.path.join(self.scriptdir, "pyvenv")
+ activate_script = os.path.join(venv_path, "bin", "activate")
+ if not os.path.isdir(venv_path):
+ print("Installing development tools in a virtual env.")
+ venv.create(venv_path, with_pip=True)
+ subprocess.check_call(
+ "source %s && pip install pre-commit git-phab" % (
+ activate_script), shell=True)
+
+ if self.update:
+ subprocess.check_call(
+ "source %s && pip install -U pre-commit git-phab" % (
+ activate_script), shell=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]