Skip to content

Commit 6fc42ae

Browse files
committed
Merge branch 'python' into node
2 parents 6305e60 + ea53250 commit 6fc42ae

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

settings/extensions/nix/nix.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ from = "860b56be91fb874d48e23a950815969a7b832fbc"
6767
#
6868
# Python (because node-gyp depends on python)
6969
#
70-
7170
[[packages]]
7271
load = [ "python38",]
7372

@@ -84,7 +83,14 @@ load = [ "python38Packages", "virtualenv",]
8483
load = [ "python38Packages", "wheel",]
8584

8685
[[packages]]
87-
load = [ "poetry",]
86+
load = [ "cmake",]
87+
88+
[[packages]]
89+
load = [ "pkg-config",]
90+
91+
[[packages]]
92+
load = [ "libffi",]
93+
8894

8995
#
9096
# for .so errors on linux with opencv+ffmpeg

settings/extensions/python/commands/ensure_pip_modules

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ then
4040
export FORNIX_FOLDER="$(dirname "$(dirname "$path_to_file")")"
4141
fi
4242

43+
echo '(which python): '"$(which python)"
44+
# if poetry not installed, install it
45+
if ! python -c "import poetry" 2>/dev/null; then
46+
python -m pip --disable-pip-version-check install poetry==1.2.1 || python -m pip --disable-pip-version-check install poetry
47+
fi
4348

4449
#
45-
# check for python-poetry first
50+
# check for python-poetry
4651
#
4752
if [ -f "$FORNIX_FOLDER/pyproject.toml" ] && [ -n "$(command -v "poetry")" ]
4853
then

settings/extensions/python/commands/setup_venv

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
export TMPDIR="$FORNIX_HOME/tmp.cleanable"
33
mkdir -p "$TMPDIR"
44
export VIRTUAL_ENV="$FORNIX_FOLDER/.venv"
5-
export PATH="$VIRTUAL_ENV/bin:$PATH"
5+
export PATH="$FORNIX_HOME/.local/bin:$PATH"
66
if ! [ -d "$VIRTUAL_ENV" ]
77
then
88
echo "creating virtual env for python"
@@ -11,5 +11,7 @@ then
1111
python -m venv "$VIRTUAL_ENV" && echo "virtual env created"
1212
fi
1313

14+
export PATH="$VIRTUAL_ENV/bin:$PATH"
15+
1416
# fix SSL issues
1517
export SSL_CERT_FILE="$(python -c 'import ssl; print(ssl.get_default_verify_paths().openssl_cafile)')"

settings/extensions/python/during_purge.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ then
2121
"$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/file_system/remove" "$FORNIX_HOME/.keras"
2222
"$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/file_system/remove" "$FORNIX_HOME/.local/share/jupyter"
2323
"$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/file_system/remove" "$FORNIX_HOME/.python_history"
24+
"$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/file_system/remove" "$FORNIX_HOME/Library/Application Support/pypoetry"
25+
"$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/file_system/remove" "$FORNIX_HOME/Library/Application Support/virtualenv"
26+
"$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/file_system/remove" "$FORNIX_HOME/Library/Library/Preferences/pypoetry"
2427
fi

0 commit comments

Comments
 (0)