@hroncok thank you very much for testing the pip beta in depth!
Would it work for you if instead of
pip install ... pyproject-wheeldir/*.whl
you do
pip install ... --no-cache-dir --no-index --find-links pyproject-wheeldir/ projectname
With that approach no direct_url.json will be recorded.
projectname could be obtained with, e.g., $(ls pyproject-wheeldir | cut -d '-' -f 1).
[updated to add --no-index, thanks @EpicWink]