Skip to content

Add the pkgutil style init file to datadog_checks_dev for support on IDEs language server #20483

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
4 changes: 0 additions & 4 deletions celery/datadog_checks/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions datadog_checks_base/changelog.d/20483.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fully migrate datadog-checks-base to include base as a namespace package
4 changes: 0 additions & 4 deletions datadog_checks_base/datadog_checks/__init__.py

This file was deleted.

14 changes: 7 additions & 7 deletions datadog_checks_base/datadog_checks/base/checks/win/winpdh.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _get_counter_dictionary(self):

try:
val, t = winreg.QueryValueEx(winreg.HKEY_PERFORMANCE_DATA, "Counter 009")
except: # noqa: E722, B001
except: # noqa: E722
self.logger.error("Windows error; performance counters not found in registry")
self.logger.error("Performance counters may need to be rebuilt.")
raise
Expand Down Expand Up @@ -166,7 +166,7 @@ def _make_counter_path(self, machine_name, en_counter_name, instance_name, count
(machine_name, self.class_name, instance_name, None, 0, en_counter_name)
)
self.logger.debug("Successfully created English-only path")
except Exception as e: # noqa: E722, B001
except Exception as e: # noqa: E722
self.logger.warning("Unable to create English-only path %s", e)
raise
return path
Expand All @@ -183,7 +183,7 @@ def _make_counter_path(self, machine_name, en_counter_name, instance_name, count
if c not in counters:
try:
self.logger.debug("Index %s counter %s not in counter list", index, str(c))
except: # noqa: E722, B001
except: # noqa: E722
# some unicode characters are not translatable here. Don't fail just
# because we couldn't log
self.logger.debug("Index %s not in counter list", index)
Expand All @@ -194,10 +194,10 @@ def _make_counter_path(self, machine_name, en_counter_name, instance_name, count
try:
path = win32pdh.MakeCounterPath((machine_name, self.class_name, instance_name, None, 0, c))
break
except: # noqa: E722, B001
except: # noqa: E722
try:
self.logger.info("Unable to make path with counter %s, trying next available", str(c))
except: # noqa: E722, B001
except: # noqa: E722
self.logger.info("Unable to make path with counter index %s, trying next available", index)
return path

Expand All @@ -217,7 +217,7 @@ def collect_counters(self):
if inst not in self.counterdict:
self.logger.debug('Adding instance `%s`', inst)
self.counterdict[inst] = win32pdh.AddCounter(self.hq, path)
except: # noqa: E722, B001
except: # noqa: E722
self.logger.fatal(
"Failed to create counter. No instances of %s\\%s" % (self.class_name, self._counter_name)
)
Expand Down Expand Up @@ -251,7 +251,7 @@ def collect_counters(self):
if SINGLE_INSTANCE_KEY not in self.counterdict:
self.logger.debug('Adding single instance for path `%s`', path)
self.counterdict[SINGLE_INSTANCE_KEY] = win32pdh.AddCounter(self.hq, path)
except: # noqa: E722, B001
except: # noqa: E722
self.logger.fatal(
"Failed to create counter. No instances of %s\\%s" % (self.class_name, self._counter_name)
)
Expand Down
4 changes: 2 additions & 2 deletions datadog_checks_base/datadog_checks/base/utils/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def create_socket_connection(hostname, port=443, sock_type=socket.SOCK_STREAM, t
if err is not None:
raise err
else:
raise socket.error('No valid addresses found, try checking your IPv6 connectivity') # noqa: G
raise socket.error('No valid addresses found, try checking your IPv6 connectivity')
except socket.gaierror as e:
err_code, message = e.args
if err_code == socket.EAI_NODATA or err_code == socket.EAI_NONAME:
raise socket.error('Unable to resolve host, check your DNS: {}'.format(message)) # noqa: G
raise socket.error('Unable to resolve host, check your DNS: {}'.format(message))

raise

Expand Down
7 changes: 4 additions & 3 deletions datadog_checks_base/datadog_checks/checks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# ruff: noqa
from ..base.checks import *
from ..errors import CheckException
from . import AgentCheck
from datadog_checks.base.checks import *
from datadog_checks.base.errors import CheckException
from datadog_checks.base.checks.base import AgentCheck
from datadog_checks.base.checks import libs, openmetrics, prometheus, win, base, network
5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/checks/base.py

This file was deleted.

4 changes: 0 additions & 4 deletions datadog_checks_base/datadog_checks/checks/libs/__init__.py

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/checks/libs/timer.py

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions datadog_checks_base/datadog_checks/checks/libs/wmi/sampler.py

This file was deleted.

6 changes: 0 additions & 6 deletions datadog_checks_base/datadog_checks/checks/network.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (C) Datadog, Inc. 2016-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from ..prometheus import PrometheusCheck, PrometheusFormat, UnknownFormatError
from datadog_checks.base.checks.prometheus import PrometheusCheck, PrometheusFormat, UnknownFormatError
5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/checks/win/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/checks/win/winpdh.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions datadog_checks_base/datadog_checks/config.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/errors.py

This file was deleted.

6 changes: 0 additions & 6 deletions datadog_checks_base/datadog_checks/log.py

This file was deleted.

1 change: 0 additions & 1 deletion datadog_checks_base/datadog_checks/py.typed

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/stubs/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/stubs/_util.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/stubs/aggregator.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/stubs/datadog_agent.py

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/common.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/containers.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/headers.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/limiter.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/platform.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/proxy.py

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/tailfile.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/timeout.py

This file was deleted.

5 changes: 0 additions & 5 deletions datadog_checks_base/datadog_checks/utils/tracing.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from prometheus_client.samples import Sample

from datadog_checks.base import ensure_bytes
from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck
from datadog_checks.dev import get_here
from datadog_checks.dev.http import MockResponse

Expand Down
Loading
Loading