Repository: mosaicml/composer

Issue:
Pyright version pinning not working
It appears that pyright versioning is still not working when using `pip install pyright`. We should switch to using the node version, which respects versioning.


Discussion:

Resolving patch:
diff --git a/docs/source/doctest_fixtures.py b/docs/source/doctest_fixtures.py
--- a/docs/source/doctest_fixtures.py
+++ b/docs/source/doctest_fixtures.py
@@ -10,7 +10,7 @@
 import functools
 import os
 import sys
-from typing import Callable
+from typing import Callable as Callable
 
 import numpy as np
 import torch.optim
@@ -21,10 +21,10 @@
 import composer
 from composer import Trainer as OriginalTrainer
 from composer import *  # Make all composer imports available in doctests
-from composer.core.logging import LogLevel
-from composer.core.time import Time, Timestamp
+from composer.core.logging import LogLevel as LogLevel
+from composer.core.time import Time as Time, Timestamp as Timestamp
 from composer.datasets.synthetic import SyntheticBatchPairDataset
-from composer.loggers import InMemoryLogger
+from composer.loggers import InMemoryLogger as InMemoryLogger
 from composer.utils import *  # Make all composer.utils imports available in doctests
 
 # Need to insert the repo root at the beginning of the path, since there may be other modules named `tests`
@@ -105,7 +105,9 @@ def Trainer(fake_ellipses='...', *args, **kwargs):
 
 
 # bind the required arguments to the Trainer so it can be used without arguments in the doctests
-Trainer = functools.partial(
+
+# Declaration "Trainer" is obscured by a declaration of the same name (reportGeneralTypeIssues)
+Trainer = functools.partial(  # type: ignore
     Trainer,
     model=model,
     max_duration="1ep",
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -76,7 +76,6 @@ def package_files(directory: str):
     'jupyter>=1.0.0',
     'yamllint>=1.26.2',
     'pytest-timeout>=1.4.2',
-    'pyright==1.1.224.post1',
     'recommonmark==0.7.1',
     'sphinx>=4.4.0',
     'docutils>=0.15',


Test patch:
diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py
--- a/tests/trainer/test_trainer.py
+++ b/tests/trainer/test_trainer.py
@@ -330,7 +330,7 @@ def config(self):
     #       with the above configuration. The fixtures below filter and
     #       create the objects to test.
 
-    @pytest.fixture(params=algorithms_registry.items(), ids=algorithms_registry.keys())
+    @pytest.fixture(params=algorithms_registry.items(), ids=tuple(algorithms_registry.keys()))
     def algorithm(self, request):
 
         name, hparams = request.param
@@ -359,7 +359,7 @@ def algorithm(self, request):
 
         return algorithm
 
-    @pytest.fixture(params=callback_registry.items(), ids=callback_registry.keys())
+    @pytest.fixture(params=callback_registry.items(), ids=tuple(callback_registry.keys()))
     def callback(self, request, tmpdir, monkeypatch):
         name, hparams = request.param
 
@@ -377,7 +377,7 @@ def callback(self, request, tmpdir, monkeypatch):
 
         return callback
 
-    @pytest.fixture(params=logger_registry.items(), ids=logger_registry.keys())
+    @pytest.fixture(params=logger_registry.items(), ids=tuple(logger_registry.keys()))
     def logger(self, request):
 
         name, hparams = request.param