Merge pull request 'use .direnv for generated project files' (#180) from Mic92-main into main

This commit is contained in:
clan-bot
2023-08-26 07:28:31 +00:00
2 changed files with 4 additions and 7 deletions

2
.gitignore vendored
View File

@@ -1,13 +1,11 @@
.direnv
result*
.pre-commit-config.yaml
# python
__pycache__
.coverage
.mypy_cache
.pytest_cache
.pythonenv
.reports
.ruff_cache
htmlcov

View File

@@ -26,21 +26,20 @@ pkgs.mkShell {
# evaluating the flake .#
CLAN_OPTIONS_FILE = ./clan_cli/config/jsonschema/options.json;
shellHook = ''
tmp_path=$(realpath ./.pythonenv)
tmp_path=$(realpath ./.direnv)
repo_root=$(realpath .)
rm -rf $tmp_path
mkdir -p "$tmp_path/${pythonWithDeps.sitePackages}"
mkdir -p "$tmp_path/python/${pythonWithDeps.sitePackages}"
${pythonWithDeps.interpreter} -m pip install \
--quiet \
--disable-pip-version-check \
--no-index \
--no-build-isolation \
--prefix "$tmp_path" \
--prefix "$tmp_path/python" \
--editable $repo_root
export PATH="$tmp_path/bin:${checkScript}/bin:$PATH"
export PYTHONPATH="$repo_root:$tmp_path/${pythonWithDeps.sitePackages}:${pythonWithDeps}/${pythonWithDeps.sitePackages}"
export PYTHONPATH="$repo_root:$tmp_path//python/${pythonWithDeps.sitePackages}:${pythonWithDeps}/${pythonWithDeps.sitePackages}"
export XDG_DATA_DIRS="$tmp_path/share''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
export fish_complete_path="$tmp_path/share/fish/vendor_completions.d''${fish_complete_path:+:$fish_complete_path}"