How can I build this python file locally?

I want to make some changes to the build that creates this path


I tried cloning nixpkgs and running nix-shell --pure -A python3Packages.pytest but it created the wrong path:


which doesn’t have the opt-2 path component (corresponding to the PYTHONOPTIMIZE level). How can I run the build that makes that path?

Looks like that file was changed recently. Nevermind.