ethpm / py-ethpm

This library is deprecated. ethPM python tooling is now located in web3.py
MIT License
24 stars 13 forks source link

Cache package `Deployment` and `Dependencies` properties #80

Closed njgheorghita closed 6 years ago

njgheorghita commented 6 years ago

Branched from #76

What was wrong?

Package.get_deployments and Package.get_build_dependencies won't change throughout a Package's life - so it makes little sense to call that method over and over

How was it fixed?

Cached the Deployments obj and Dependencies obj as properties on the Package obj using the cached_property from Django https://docs.djangoproject.com/en/2.0/_modules/django/utils/functional/#cached_property

Cute Animal Picture

image

njgheorghita commented 6 years ago

@pipermerriam Thanks for the review - it's actually branched off of pr #76 which is still waiting review - is there a better way to handle this? Probably leave off the ready for review label until the preceding pr is merged and I can rebase?