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

Remove the use of the deprecated pkg_resources package #13842

Merged
merged 4 commits into from
Jan 31, 2023
Merged

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Jan 31, 2023

Additional Notes

This package is also used in a few test suites but that will be a separate PR so changelogs don't get affected

fridex
fridex previously approved these changes Jan 31, 2023
@github-actions
Copy link

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

@codecov
Copy link

codecov bot commented Jan 31, 2023

Codecov Report

Merging #13842 (427b2e9) into master (0ff1f1f) will decrease coverage by 0.37%.
The diff coverage is 100.00%.

Flag Coverage Δ
active_directory 100.00% <ø> (+17.64%) ⬆️
activemq_xml 82.31% <ø> (ø)
amazon_msk 88.67% <ø> (ø)
ambari 85.75% <ø> (ø)
apache 95.08% <ø> (ø)
arangodb 98.21% <ø> (ø)
argocd 88.43% <ø> (ø)
aspdotnet 100.00% <ø> (+26.19%) ⬆️
avi_vantage 92.50% <ø> (ø)
azure_iot_edge 82.00% <ø> (ø)
boundary 100.00% <ø> (ø)
btrfs 82.91% <ø> (ø)
cacti 87.90% <ø> (ø)
calico 83.33% <ø> (ø)
cilium 75.34% <ø> (+0.93%) ⬆️
cisco_aci 95.27% <ø> (ø)
citrix_hypervisor 87.50% <ø> (ø)
cloud_foundry_api 95.98% <ø> (+0.12%) ⬆️
cloudera 99.17% <ø> (ø)
cockroachdb 90.96% <ø> (ø)
consul 91.64% <ø> (ø)
coredns 94.54% <ø> (ø)
couchbase 84.42% <ø> (ø)
crio 89.79% <ø> (ø)
datadog_cluster_agent 90.00% <ø> (ø)
ddev 98.64% <ø> (ø)
directory 96.50% <ø> (ø)
disk 89.53% <ø> (-2.17%) ⬇️
dns_check 93.90% <ø> (ø)
dotnetclr 94.93% <ø> (+15.18%) ⬆️
druid 97.70% <ø> (ø)
ecs_fargate 80.92% <ø> (ø)
eks_fargate 94.05% <ø> (ø)
envoy 94.00% <ø> (ø)
external_dns 89.09% <ø> (ø)
fluentd 94.77% <ø> (ø)
foundationdb 78.50% <ø> (ø)
go_expvar 92.73% <ø> (ø)
gunicorn 92.85% <ø> (ø)
harbor 80.04% <ø> (ø)
hazelcast 92.39% <ø> (ø)
hdfs_datanode 89.74% <ø> (ø)
hdfs_namenode 86.72% <ø> (ø)
http_check 95.75% <ø> (+2.18%) ⬆️
ibm_ace 91.79% <ø> (ø)
ibm_db2 95.10% <ø> (ø)
ibm_i 81.95% <ø> (ø)
ibm_mq 51.95% <ø> (-39.42%) ⬇️
impala 97.97% <ø> (ø)
istio 77.65% <ø> (+0.55%) ⬆️
kong 87.56% <ø> (ø)
kube_apiserver_metrics 97.69% <ø> (ø)
kube_dns 95.97% <ø> (ø)
kube_metrics_server 94.87% <ø> (ø)
kube_proxy 96.80% <ø> (ø)
kube_scheduler 96.53% <ø> (ø)
kubelet 90.96% <ø> (ø)
kubernetes_state 89.18% <ø> (ø)
kyototycoon 85.96% <ø> (ø)
lighttpd 83.64% <ø> (ø)
linkerd 85.14% <ø> (+1.14%) ⬆️
linux_proc_extras 96.22% <ø> (ø)
mapr 82.70% <ø> (ø)
mapreduce 81.81% <ø> (ø)
marathon 83.12% <ø> (ø)
mcache 93.50% <ø> (+0.23%) ⬆️
mesos_master 89.75% <ø> (ø)
nagios 89.01% <ø> (ø)
network 93.92% <ø> (+0.95%) ⬆️
nfsstat 95.20% <ø> (ø)
nginx 95.24% <ø> (+0.54%) ⬆️
nginx_ingress_controller 98.36% <ø> (ø)
openldap 96.33% <ø> (ø)
openmetrics 97.90% <ø> (ø)
openstack 51.45% <ø> (ø)
openstack_controller 90.93% <ø> (ø)
pgbouncer 91.33% <ø> (ø)
php_fpm 90.25% <ø> (+0.84%) ⬆️
postfix 88.04% <ø> (ø)
powerdns_recursor 96.65% <ø> (ø)
process 85.42% <ø> (+0.28%) ⬆️
proxysql 98.97% <ø> (ø)
pulsar 100.00% <ø> (ø)
rethinkdb 97.93% <ø> (ø)
riak 99.22% <ø> (ø)
silk 93.33% <ø> (ø)
singlestore 90.81% <ø> (ø)
snowflake 96.47% <ø> (ø)
statsd 87.36% <ø> (+1.05%) ⬆️
supervisord 92.30% <ø> (ø)
system_core 90.90% <ø> (ø)
system_swap 98.30% <ø> (ø)
tcp_check 91.58% <ø> (ø)
teradata 94.24% <ø> (ø)
tls 91.82% <ø> (+0.84%) ⬆️
tokumx 58.40% <ø> (?)
traffic_server 96.13% <ø> (ø)
twemproxy 79.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@github-actions
Copy link

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

@@ -28,7 +28,7 @@ def substitute(target_relpath):
if not wheel_distribution_name.startswith('datadog_'):
raise NonDatadogPackage(wheel_distribution_name)

standard_distribution_name = safe_name(wheel_distribution_name)
standard_distribution_name = canonicalize_name(wheel_distribution_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ofek have you checked that this function does the same thing? I assume you have, but just double-checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For our use case, yes

Comment on lines -109 to -110
def get_library_versions(cls):
return {"memcache": pkg_resources.get_distribution("python-binary-memcached").version}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is entirely removed, is there no alternative to using pkg_resources to implement this function?

Copy link
Contributor

@fridex fridex Jan 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each entry in importlib.metadata.distributions() iterator should have version attribute (docs). See also version function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was not being used by anything so I simply removed it

@ofek ofek merged commit 029e00f into master Jan 31, 2023
@ofek ofek deleted the ofek/metadata-utils branch January 31, 2023 21:15
github-actions bot pushed a commit that referenced this pull request Jan 31, 2023
* Remove the use of the deprecated `pkg_resources` package

* pin

* Update LICENSE-3rdparty.csv

* fix test 029e00f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants