diff --git a/lua/pymple/utils.lua b/lua/pymple/utils.lua index 008ce0b..be71146 100644 --- a/lua/pymple/utils.lua +++ b/lua/pymple/utils.lua @@ -71,10 +71,6 @@ local MAX_UPWARD_JUMPS = 10 ---@param starting_dir string: The directory to start searching from ---@return string | nil: The root of the python project local function find_project_root(starting_dir, root_markers) - local pythonpath = os.getenv("PYTHONPATH") - if pythonpath then - return pythonpath - end local dir if Path:new(starting_dir):is_dir() then dir = starting_dir diff --git a/lua/tests/utils_spec.lua b/lua/tests/utils_spec.lua index dc80c21..9664adb 100644 --- a/lua/tests/utils_spec.lua +++ b/lua/tests/utils_spec.lua @@ -4,16 +4,7 @@ local cwd = vim.fn.getcwd() local mock = require("luassert.mock") describe("find_project_root", function() - it("pythonpath", function() - mock(os, "getenv", function() - return "/some/path" - end) - local result = utils.find_project_root(nil, {}) - assert.equals("/some/path", result) - mock.revert(os) - end) - - it("no pythonpath and src", function() + it("src present", function() local result = utils.find_project_root( FIXTURES_PATH .. "/project_with_src/src", { "pyproject.toml" } @@ -21,7 +12,7 @@ describe("find_project_root", function() assert.equals(FIXTURES_PATH .. "/project_with_src/src", result) end) - it("no pythonpath and no src", function() + it("no src", function() local result = utils.find_project_root( FIXTURES_PATH .. "/project/module/__init__.py", { "pyproject.toml" }