You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After installing the latest datadog 0.37.0 wheel release using a Python version < 3.5, a typing package import error is raised when importing datadog.
To Reproduce
Steps to reproduce the behavior:
Install a version of Python < 3.5 (for example, Python 3.4 or Python 2.7).
Install the wheel release of datadog 0.37.0 by running pip install datadog.
Try importing datadog in an interactive interpreter to see the import error:
>>> import datadog
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "datadog/__init__.py", line 17, in <module>
from typing import Any, List, Optional
ImportError: No module named typing
Expected behavior
The typing package should be included in the wheel's install requirements if Python < 3.5 is being used.
In setup.py, the typing package is added to install_requires if running a Python version < 3.5 (otherwise, the package is already included in the standard library for newer Python versions). This optional typing dependency is correctly installed when running python setup.py install or pip-installing from source. The wheel release that is installed via pip install datadog doesn't include the typing dependency (probably because the wheel release isn't Python version specific).
A couple of solutions come to mind:
(Probably easiest) Always include the typing package in install_requires, regardless of Python version. According to the typing package docs, if typing is already part of the standard library, installing the package has no effect.
Create separate wheel releases for Python < 3.5 and Python >= 3.5.
Environment and Versions:
Version: datadog 0.37.0
Tested with Python 2.7.15 on macOS 10.15.5.
Additional context
The typing package import was added in PR #565. Thanks @justinsousa for pointing out this issue!
The text was updated successfully, but these errors were encountered:
After installing the typing package on Python 2.7, I'm now seeing an import error from configparser in datadog.util.compat. The unit and integration tests install tox before running, which was implicitly installing configparser as one of its dependencies. I'll submit a PR shortly to explicitly include typing and configparser as dependencies (regardless of Python version).
For users running into typing or configparser import errors with datadog 0.37.0, installing the packages should fix the issue:
pip install typing configparser
jairideout
added a commit
to jairideout/datadogpy
that referenced
this issue
Jun 22, 2020
Describe the bug
After installing the latest datadog 0.37.0 wheel release using a Python version < 3.5, a
typing
package import error is raised when importingdatadog
.To Reproduce
Steps to reproduce the behavior:
pip install datadog
.datadog
in an interactive interpreter to see the import error:Expected behavior
The
typing
package should be included in the wheel's install requirements if Python < 3.5 is being used.In
setup.py
, thetyping
package is added toinstall_requires
if running a Python version < 3.5 (otherwise, the package is already included in the standard library for newer Python versions). This optionaltyping
dependency is correctly installed when runningpython setup.py install
or pip-installing from source. The wheel release that is installed viapip install datadog
doesn't include thetyping
dependency (probably because the wheel release isn't Python version specific).A couple of solutions come to mind:
typing
package ininstall_requires
, regardless of Python version. According to thetyping
package docs, iftyping
is already part of the standard library, installing the package has no effect.Environment and Versions:
Version: datadog 0.37.0
Tested with Python 2.7.15 on macOS 10.15.5.
Additional context
The
typing
package import was added in PR #565. Thanks @justinsousa for pointing out this issue!The text was updated successfully, but these errors were encountered: