In particular, the following errors are fixed in this commit:
* Don't return False in __exit__
Returning a literal causes a mypy error when combined with the
`typing.Optional[bool]` type hint. Furthermore, exception handling is
the same when returning `False` and when returning `None` (the
exception is re-raised). Therefore, it's simpler to remove the return
statement and change the type hint to `None`.
* Correctly initialize nested tuple
Tuples of length 1 should be initialized with a trailing comma to be
properly interpreted.
* Pass correct type to use_context() in test
* Add type annotations for test helper functions
Since we have `disallow_untyped_calls = True` in our mypy config for
tests, we must add type annotations to any function that is called
from a test.
Addditionally, bump minimal mypy version to 0.740 to consistently reproduce these errors.
* Ensure that type info is picked up from installed package.
This required moving all top-level modules to a sub-package, to not
create collisions with py.typed marker files.
See https://www.python.org/dev/peps/pep-0561/#packaging-type-information
* Add MANIFEST.in for SDK package.
* Fix setup for ext packages.
Previously the wheels would contain the metadata but not the actual
code.
* Check that all packages install properly in test.
* Document why we don't use -e.
Adds requests integration. Two commits that might be of special interest (see #94):
* c66af2faa100b0f41afafdb6e4de9f4de4cc62bc requests test: Use actual Response object.
Co-Authored-By: Allan Feldman <6374032+a-feld@users.noreply.github.com>
* 1b90a0ddc286c936f7256b14e14ef36fd3c6a24f More tests, rename to http-requests to work around pylint bug (?)
See previous CI failure for pylint issue:
************* Module ext/opentelemetry-ext-requests/src/__init__.py
ext/opentelemetry-ext-requests/src/__init__.py:1:0: F0001: No module named ext/opentelemetry-ext-requests/src/__init__.py (fatal)
It seems that pylint gets confused when there is more than one "requests" module??
I believe it would be nice to have
tests on CI not only for Python 3.7,
but for all supported Python versions.
These changes:
- fix compatibility with Python 3.5 and 3.4
- add tests for various Python versions on CI
- allow running tests for any branches
* Add .pylintrc based on OpenCensus (related #6).
* Fix/disable pylint warnings.
* pylint: Fix W0107: Unnecessary pass statement (unnecessary-pass)
I'm not sure I like this warning.