Skip to content

Commit

Permalink
cleanup python directory
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Mar 22, 2024
1 parent 8c97d19 commit 37cb967
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
5 changes: 3 additions & 2 deletions examples/python-directory/.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
set -exu
POETRY_VENV="$PWD/directory/.venv"
[ -d "$POETRY_VENV" ]
[ "$(poetry env info --path)" = "$POETRY_VENV" ]
[ "$(command -v python)" = "$POETRY_VENV/bin/python" ]
python --version
poetry --version
poetry run python -c 'import requests'
python -c 'import requests'
cd directory
[ "$(poetry env info --path)" = "$POETRY_VENV" ]
poetry run python -c 'import requests'
2 changes: 0 additions & 2 deletions examples/python-directory/devenv.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
nixpkgs-python:
url: github:cachix/nixpkgs-python
2 changes: 1 addition & 1 deletion examples/python-poetry/.test.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -exu

POETRY_VENV="$PWD/.venv"
[ -d "$POETRY_VENV" ]
[ "$(poetry env info --path)" = "$POETRY_VENV" ]
[ "$(command -v python)" = "$POETRY_VENV/bin/python" ]
python --version
poetry --version
poetry run python -c "import os; print(os.environ['LD_LIBRARY_PATH'])"
ls .devenv/profile/lib
poetry run python -c 'import numpy'
python -c 'import numpy'
python -c 'import pjsua2'
9 changes: 1 addition & 8 deletions examples/python-poetry/devenv.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{ pkgs, config, ... }:
{ pkgs, lib, config, ... }:

{
packages = [
# A python dependency outside of poetry.
config.languages.python.package.pkgs.pjsua2
];

# this envvar can be removed and the lib can be moved into
# languages.python.libraries when we start working against env-venv
env.LD_LIBRARY_PATH = lib.makeLibraryPath [
# A native dependency of numpy
pkgs.zlib
];

languages.python = {
enable = true;
poetry = {
Expand Down
2 changes: 0 additions & 2 deletions examples/python-poetry/devenv.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
nixpkgs-python:
url: github:cachix/nixpkgs-python

0 comments on commit 37cb967

Please sign in to comment.