Closed pipermerriam closed 6 years ago
The (name, version)
tuple is non-unique, right? Maybe it's worth adding more info here to get to uniqueness (or close enough). I imagine the first 20 characters of the content hash are sufficient. Or maybe there's some other attribute that's better.
I imagine the first 20 characters of the content hash are sufficient. Or maybe there's some other attribute that's better.
I'm 👍 on this to be done in a separate issue which exposes a new property Package.hash
which returns the keccak256 hash of the package contents.
Also, see https://github.com/ethpm/ethpm-spec/issues/77 which should help with hashing packages in a consistent manner.
What needs to be done?
Packages have a few simple properties:
package_name
version
These properties should be exposed on the
Package
object through thePackage.name
andPackage.version
properties.Additionally, implement a
__repr__
function on thePackage
object which returns a string formatted like<Package {package_name}=={version})>
.