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

Implemented better backoff version checking and added unit test #3010

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

import toml

deps = toml.load('./exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml')['project']
dependencies = deps['dependencies']
backoff = dependencies[0].split(';')[0]
info = backoff.split()
package_name = info[0]
package_version = info[-1]

pkgs = dict([(package_name, package_version)])


def package_version(r):
def wrapper(f):
r.version = pkgs[f]
return r
return wrapper

@package_version
def get_distribution(package_name):
return pkgs[package_name]

Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@ def trailing_metadata(self):
"while exporting mock, retrying in 0s."
),
)

def test_backoff_version_checking(self):
import pkg_resources
backoff_version = pkg.get_distribution('backoff').version
self.assertEqual(backoff_version, '2.0.0')