-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implemented better backoff version checking and added unit test…
… for the feature
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
exporter/opentelemetry-exporter-otlp-proto-grpc/pkg_resources/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters