Skip to content

test_no_duplicate_egg_info fails with wrong egg_base #270

@bnavigator

Description

@bnavigator
[   18s] __________________________ test_no_duplicate_egg_info __________________________
[   18s] 
[   18s]     def test_no_duplicate_egg_info():
[   18s]         """When the package has 'src' directory, do not write egg-info in base
[   18s]         dir."""
[   18s]         base_dir = vistir.compat.Path(os.path.abspath(os.getcwd())).as_posix()
[   18s]         r = Requirement.from_line("-e {}".format(base_dir))
[   18s]         egg_info_name = "{}.egg-info".format(r.name.replace("-", "_"))
[   18s]         distinfo_name = "{0}.dist-info".format(r.name.replace("-", "_"))
[   18s]     
[   18s]         def find_metadata(path):
[   18s]             metadata_names = [
[   18s]                 os.path.join(path, name) for name in (egg_info_name, distinfo_name)
[   18s]             ]
[   18s]             if not os.path.isdir(path):
[   18s]                 return None
[   18s]             pth = next(iter(pth for pth in metadata_names if os.path.isdir(pth)), None)
[   18s]             if not pth:
[   18s]                 pth = next(
[   18s]                     iter(
[   18s]                         pth
[   18s]                         for pth in os.listdir(path)
[   18s]                         if any(
[   18s]                             pth.endswith(md_ending)
[   18s]                             for md_ending in [".egg-info", ".dist-info", ".whl"]
[   18s]                         )
[   18s]                     ),
[   18s]                     None,
[   18s]                 )
[   18s]             return pth
[   18s]     
[   18s]         assert not find_metadata(base_dir)
[   18s]         assert not find_metadata(os.path.join(base_dir, "reqlib-metadata"))
[   18s]         assert not find_metadata(os.path.join(base_dir, "src", "reqlib-metadata"))
[   18s]         assert r.req.setup_info and os.path.isdir(r.req.setup_info.egg_base)
[   18s]         setup_info = r.req.setup_info
[   18s]         setup_info.get_info()
[   18s] >       assert (
[   18s]             find_metadata(setup_info.egg_base)
[   18s]             or find_metadata(setup_info.extra_kwargs["build_dir"])
[   18s]             or setup_info.get_egg_metadata()
[   18s]         )
[   18s] E       AssertionError: assert (None or None or None)

Maybe this is wrong:

(Pdb) print(setup_info.egg_base)
/home/abuild/rpmbuild/BUILD/requirementslib-1.5.13/reqlib-metadata

Full log with package version information:
requirementslib_log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions