Skip to content

Do not raise exception on name/type mismatch for package instance creation #2886

@AyanSinhaMahapatra

Description

@AyanSinhaMahapatra

Description

Please leave a brief description of the bug or feature request:

Traceback (most recent call last):
  File "/home/jono/Desktop/misc/test/scancode-toolkit/src/scancode/cli.py", line 1055, in run_codebase_plugins
    plugin.process_codebase(codebase, **kwargs)
  File "/home/jono/Desktop/misc/test/scancode-toolkit/src/packagedcode/plugin_package.py", line 120, in process_codebase
    create_package_and_dep_instances(codebase, **kwargs)
  File "/home/jono/Desktop/misc/test/scancode-toolkit/src/packagedcode/plugin_package.py", line 180, in create_package_and_dep_instances
    pk_instance.populate_package_data(package_data_by_path, uuid=pk_instance_uuid)
  File "/home/jono/Desktop/misc/test/scancode-toolkit/src/packagedcode/models.py", line 846, in populate_package_data
    self.update(package_data.copy())
  File "/home/jono/Desktop/misc/test/scancode-toolkit/src/packagedcode/models.py", line 970, in update
    '    new_value: {}'.format(new_value)
Exception: Mismatched name:
    existing_value: setuptools
    new_value: my-test-package

Exception being raised here: https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/models.py#L966

This was happening because we were looking into manifests from test folders too btw, in this case: setuptools-58.2.0/pkg_resources/tests/data/my-test-package-source/setup.cfg

How To Reproduce

Tell us how to reproduce the issue.

Scan setuptools-58.2.0 with scancode-toolkit develop at 86c7db5

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions