You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
Container-diff makes an assumption that a package name is always
a sub-string of the installation path - which isn't always the case.
Ideally package names could come from pip, pkg_resources and such - however I understand it may not be possible without tampering with the container too much (or making the analysis complicated). Would it not be possible to use pip to report that information back to container-diff, likely the second best method would be to check the package meta-data file, for example:
# a package name consistent with what PIP says can be retrieved from PKG-INFO, e.g.:
root@c76f09d5f006:/usr/local/lib/python3.5/dist-packages/strict_rfc3339-0.7.egg-info# pip show -f strict-rfc3339
Name: strict-rfc3339
Version: 0.7
Summary: Strict, simple, lightweight RFC3339 functions
Home-page: http://www.danielrichman.co.uk/libraries/strict-rfc3339.html
Author: Daniel Richman, Adam Greig
Author-email: [email protected]
License: GNU General Public License Version 3
Location: /usr/local/lib/python3.5/dist-packages
Requires:
Required-by: sm-adapters
Files:
__pycache__/strict_rfc3339.cpython-35.pyc
strict_rfc3339-0.7.egg-info/PKG-INFO
strict_rfc3339-0.7.egg-info/SOURCES.txt
strict_rfc3339-0.7.egg-info/dependency_links.txt
strict_rfc3339-0.7.egg-info/top_level.txt
strict_rfc3339.py
root@c76f09d5f006:/usr/local/lib/python3.5/dist-packages/strict_rfc3339-0.7.egg-info# grep Name /usr/local/lib/python3.5/dist-packages/strict_rfc3339-0.7.egg-info/PKG-INFO
Name: strict-rfc3339
@weakcamel thanks again for this issue. As I said in #281 there are definitely a few issues here. I opened a PR to try and use the top_level.txt for egg modules which seems to be pretty reliable, but I agree that the METADATA file can also give us the information we want.
I'll work on a fix that tries to use both of those files to more reliably get the package name.
container-diff
reports the package names with dashes replaced with underscores.I believe the reason for that are the few lines of code here:
container-diff/differs/pip_diff.go
Line 89 in 616e266
Container-diff makes an assumption that a package name is always
a sub-string of the installation path - which isn't always the case.
Ideally package names could come from
pip
,pkg_resources
and such - however I understand it may not be possible without tampering with the container too much (or making the analysis complicated). Would it not be possible to usepip
to report that information back tocontainer-diff
, likely the second best method would be to check the package meta-data file, for example:Expected behavior
Package name for a package with a dash in the name, e.g.
https://pypi.org/project/strict-rfc3339/
should be reported as
strict-rfc3339
.Actual behavior
Package name with an underscore, e.g. https://pypi.org/project/strict-rfc3339/
is being reported as
strict_rfc3339
.Information
Steps to reproduce the behavior
whereas for comparison:
The text was updated successfully, but these errors were encountered: