Skip to content

Source files aren't listed in dist-info/RECORD for editable installs. #609

@fofoni

Description

@fofoni

OS version

Ubuntu 20.04

Python version

3.7.13

Pip version

22.2.2

Guide link

https://packaging.python.org/tutorials/packaging-projects

Problem description

I configured my project exactly like the tutorial, but then before building a wheel and uploading, I want to develop locally with an editable install. I run pip install -e . and then a .dist-info directory and a .pth file are created inside my virtualenv's site-packages. Inside the .dist-info directory, the RECORD file lists only metadata files (readme, license, etc) but no source files. I tested, and if I make a regular install instead (pip install .) then the RECORD file will correctly list all .py files. Also, with the editable install, the package can be imported and works as expected. I'm using hatchling as the build backend, but I tested with flit and the behavior is the same.

Is the lack of source files in the RECORD expected for an editable install?

Context: as far as I understand, the lack of .py files in dist-info/RECORD is what is preveting importlib_metadata.packages_distributions() from listing my package. I have some other local packages installed with pip install -e which use setuptools/setup.py, and these appear in the site-packages as .egg-link files. These are correctly listed by importlib_metadata.packages_distributions(). Is this a bug in importlib_metadata?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions