Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AyanSinhaMahapatra opened this issue Mar 9, 2022 · 0 comments · Fixed by #2887
Closed
Assignees
Labels

Comments

@AyanSinhaMahapatra
Copy link
Member

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

@AyanSinhaMahapatra AyanSinhaMahapatra self-assigned this Mar 9, 2022
AyanSinhaMahapatra added a commit that referenced this issue Mar 9, 2022
Do not raise exceptions and fail in package instance creation
if there is name/type/version mismatch between detected
package_data. Adds test to verify.

Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
JonoYang added a commit that referenced this issue Mar 9, 2022
Do not raise exception on package data mismatch #2886
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant