diff --git a/.envrc b/.envrc index 4eb27b3..bed79ab 100644 --- a/.envrc +++ b/.envrc @@ -1,9 +1,2 @@ use flake nix profile wipe-history --profile "$(direnv_layout_dir)/flake-profile" --older-than 14d - -if [[ -n "${DEV_INSTALL_EDITABLE:-}" ]]; then - install_dir=$(mktemp -d) - PIP_DISABLE_PIP_VERSION_CHECK=1 pip install -e . --prefix $install_dir - export PATH=$install_dir/bin:$PATH - export PYTHONPATH=.:$PYTHONPATH -fi \ No newline at end of file diff --git a/flake.lock b/flake.lock index 6651608..a50ec1c 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "lastModified": 1732837521, + "narHash": "sha256-jNRNr49UiuIwaarqijgdTR2qLPifxsVhlJrKzQ8XUIE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "970e93b9f82e2a0f3675757eb0bfc73297cc6370", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ede3524..2eb5241 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,16 @@ ]; }; + editablePkg = pkg.overrideAttrs (oldAttrs: { + nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ + (python3.pkgs.mkPythonEditablePackage { + pname = pyproject.project.name; + inherit (pyproject.project) scripts version; + root = "$PWD"; + }) + ]; + }); + in { packages.default = pkg; devShells.default = mkShell { @@ -47,7 +57,7 @@ twine types-pyyaml ]; - inputsFrom = [ pkg ]; + inputsFrom = [ editablePkg ]; }; }); } diff --git a/pyproject.toml b/pyproject.toml index 4dd2bd9..3c5d817 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,6 @@ lint.ignore = [ "INP", # implicit-namespace-packagepydocstyle "ISC001", # Implicitly concatenated string literals on one line "S101", # Use of `assert` detected - "PT005", # fixture with leading `_` returns a value "PLR2004", # magic value in comparison "TRY400", # use logging.exception ]