-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the use of the deprecated
pkg_resources
package (#13842)
* Remove the use of the deprecated `pkg_resources` package * pin * Update LICENSE-3rdparty.csv * fix test
- Loading branch information
Showing
7 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ futures,PyPI,PSF,Copyright (c) 2015 Brian Quinlan | |
gearman,PyPI,Apache-2.0,Copyright 2010 Yelp <[email protected]> | ||
gssapi,PyPI,ISC,"Copyright (c) 2014, The Python GSSAPI Team" | ||
immutables,PyPI,Apache-2.0,Copyright 2018-present Contributors to the immutables project. | ||
importlib-metadata,PyPI,Apache-2.0,Copyright Jason R. Coombs | ||
in-toto,PyPI,Apache-2.0,Copyright 2018 New York University | ||
ipaddress,PyPI,PSF,Copyright (c) 2013 Philipp Hagemeister | ||
jellyfish,PyPI,BSD-3-Clause,"Copyright (c) 2015, James Turk" | ||
|
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
20 changes: 12 additions & 8 deletions
20
datadog_checks_base/datadog_checks/base/utils/agent/packages.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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
# (C) Datadog, Inc. 2019-present | ||
# All rights reserved | ||
# Licensed under a 3-clause BSD style license (see LICENSE) | ||
import sys | ||
|
||
import pkg_resources | ||
if sys.version_info >= (3, 8): | ||
from importlib.metadata import distributions | ||
else: | ||
from importlib_metadata import distributions | ||
|
||
DATADOG_CHECK_PREFIX = "datadog-" | ||
DATADOG_CHECK_PREFIX = 'datadog-' | ||
|
||
|
||
def get_datadog_wheels(): | ||
packages = [] | ||
dist = list(pkg_resources.working_set) | ||
for package in dist: | ||
if package.project_name.startswith(DATADOG_CHECK_PREFIX): | ||
name = package.project_name[len(DATADOG_CHECK_PREFIX) :].replace('-', '_') | ||
packages.append(name) | ||
packages = set() | ||
for package in distributions(): | ||
project_name = package.metadata['Name'] | ||
if project_name.startswith(DATADOG_CHECK_PREFIX): | ||
name = project_name[len(DATADOG_CHECK_PREFIX) :].replace('-', '_') | ||
packages.add(name) | ||
|
||
return sorted(packages)[::-1] |
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
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
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
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