Repository: open-telemetry/opentelemetry-python

Issue:
lint failing in main
`tox -e lint` is failing in the latest `main` commit:

```
lint create: /home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint
lint installdeps: -cdev-requirements.txt, asgiref, pylint, flake8, isort, black, psutil, readme_renderer, httpretty, GitPython
ERROR: invocation failed (exit code 1), logfile: /home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/log/lint-1.log
================================== log start ===================================
Collecting asgiref
  Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)
Collecting pylint
  Downloading pylint-2.7.1-py3-none-any.whl (343 kB)
Collecting flake8
  Downloading flake8-3.9.2-py2.py3-none-any.whl (73 kB)
Collecting isort
  Downloading isort-5.9.3-py3-none-any.whl (106 kB)
Collecting black
  Downloading black-20.8b1.tar.gz (1.1 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/bin/python /home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpmhmnt7wq
         cwd: /tmp/pip-install-fmn02051/black_a604d4ca631c4d218919aa38832c5c95
    Complete output (30 lines):
    Traceback (most recent call last):
      File "/home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
        main()
      File "/home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 133, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 48, in <module>
        setup(
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/home/ocelotl/.pyenv/versions/3.9.5/lib/python3.9/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 455, in __init__
        _Distribution.__init__(self, {
      File "/home/ocelotl/.pyenv/versions/3.9.5/lib/python3.9/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 807, in finalize_options
        ep(self)
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools_scm/integration.py", line 52, in infer_version
        config = Configuration.from_file(dist_name=dist_name)
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools_scm/config.py", line 187, in from_file
        defn = _load_toml(data)
      File "/tmp/pip-build-env-zk_0ydvo/overlay/lib/python3.9/site-packages/setuptools_scm/config.py", line 59, in _lazy_tomli_load
        from tomli import loads
    ModuleNotFoundError: No module named 'tomli'
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/dc/7b/5a6bbe89de849f28d7c109f5ea87b65afa5124ad615f3419e71beb29dc96/black-20.8b1.tar.gz#sha256=1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea (from https://pypi.org/simple/black/) (requires-python:>=3.6). Command errored out with exit status 1: /home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/bin/python /home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpmhmnt7wq Check the logs for full command output.
ERROR: Cannot install black because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested black
    The user requested (constraint) black~=20.8b1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
WARNING: You are using pip version 21.1.3; however, version 21.2.4 is available.
You should consider upgrading via the '/home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/bin/python -m pip install --upgrade pip' command.

=================================== log end ====================================
ERROR: could not install deps [-cdev-requirements.txt, asgiref, pylint, flake8, isort, black, psutil, readme_renderer, httpretty, GitPython]; v = InvocationError('/home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/bin/python -m pip install -cdev-requirements.txt asgiref pylint flake8 isort black psutil readme_renderer httpretty GitPython', 1)
___________________________________ summary ____________________________________
ERROR:   lint: could not install deps [-cdev-requirements.txt, asgiref, pylint, flake8, isort, black, psutil, readme_renderer, httpretty, GitPython]; v = InvocationError('/home/ocelotl/github/ocelotl/opentelemetry-python/.tox/lint/bin/python -m pip install -cdev-requirements.txt asgiref pylint flake8 isort black psutil readme_renderer httpretty GitPython', 1)
```


Discussion:

Resolving patch:
diff --git a/opentelemetry-api/src/opentelemetry/context/context.py b/opentelemetry-api/src/opentelemetry/context/context.py
--- a/opentelemetry-api/src/opentelemetry/context/context.py
+++ b/opentelemetry-api/src/opentelemetry/context/context.py
@@ -39,7 +39,7 @@ def attach(self, context: Context) -> object:
 
     @abstractmethod
     def get_current(self) -> Context:
-        """Returns the current `Context` object. """
+        """Returns the current `Context` object."""
 
     @abstractmethod
     def detach(self, token: object) -> None:
diff --git a/opentelemetry-api/src/opentelemetry/context/contextvars_context.py b/opentelemetry-api/src/opentelemetry/context/contextvars_context.py
--- a/opentelemetry-api/src/opentelemetry/context/contextvars_context.py
+++ b/opentelemetry-api/src/opentelemetry/context/contextvars_context.py
@@ -44,7 +44,7 @@ def attach(self, context: Context) -> object:
         return self._current_context.set(context)
 
     def get_current(self) -> Context:
-        """Returns the current `Context` object. """
+        """Returns the current `Context` object."""
         return self._current_context.get()
 
     def detach(self, token: object) -> None:


Test patch:
diff --git a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger.py b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger.py
--- a/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger.py
+++ b/exporter/opentelemetry-exporter-jaeger/tests/test_jaeger.py
@@ -23,7 +23,7 @@
 # pylint:disable=no-member
 class TestJaegerExporter(unittest.TestCase):
     def test_constructors(self):
-        """ Test ensures both exporters can co-exist"""
+        """Test ensures both exporters can co-exist"""
         try:
             grpc.JaegerExporter()
             thrift.JaegerExporter()