From 33af4dca9c752bbb273bc854b74d839f5219f0cf Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Thu, 17 Oct 2024 09:50:00 +0300 Subject: [PATCH 1/4] fix `pyright.reportRedeclaration` --- gymnasium/envs/box2d/lunar_lander.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/gymnasium/envs/box2d/lunar_lander.py b/gymnasium/envs/box2d/lunar_lander.py index 976647b15..63ebae816 100644 --- a/gymnasium/envs/box2d/lunar_lander.py +++ b/gymnasium/envs/box2d/lunar_lander.py @@ -374,7 +374,7 @@ def reset( # Create Lander body initial_y = VIEWPORT_H / SCALE initial_x = VIEWPORT_W / SCALE / 2 - self.lander: Box2D.b2Body = self.world.CreateDynamicBody( + self.lander = self.world.CreateDynamicBody( position=(initial_x, initial_y), angle=0.0, fixtures=fixtureDef( diff --git a/pyproject.toml b/pyproject.toml index 8e0235936..54ec2f79e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,7 +157,6 @@ reportCallIssue = "none" # TODO fix one by one reportOperatorIssue = "none" # TODO fix one by one reportInvalidTypeForm = "none" # TODO fix one by one reportOptionalMemberAccess = "none" # TODO fix one by one -reportRedeclaration = "none" # TODO fix one by one reportAssignmentType = "none" # TODO fix one by one From 132e31f18ff15c5b2f4bc4fdf49dcce1b5c41736 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Thu, 17 Oct 2024 10:56:25 +0300 Subject: [PATCH 2/4] re-enable `pyright.reportPrivateImportUsage` and `pyright.reportUnboundVariable ` --- pyproject.toml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 54ec2f79e..6b5e01db1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,19 +137,14 @@ reportMissingTypeStubs = false # For warning and error, will raise an error when reportInvalidTypeVarUse = "none" -# reportUnknownMemberType = "warning" # -> raises 6035 warnings -# reportUnknownParameterType = "warning" # -> raises 1327 warnings -# reportUnknownVariableType = "warning" # -> raises 2585 warnings -# reportUnknownArgumentType = "warning" # -> raises 2104 warnings reportGeneralTypeIssues = "none" # -> commented out raises 489 errors -# reportUntypedFunctionDecorator = "none" # -> pytest.mark.parameterize issues -reportAttributeAccessIssue = "none" -reportArgumentType = "none" +reportAttributeAccessIssue = "none" # pyright provides false positives +reportArgumentType = "none" # pyright provides false positives reportPrivateUsage = "warning" -reportUnboundVariable = "warning" +# reportUnboundVariable = "warning" -reportPrivateImportUsage = "none" # -> commented out raises 144 errors +# reportPrivateImportUsage = "none" # -> commented out raises 144 errors reportIndexIssue = "none" # TODO fix one by one reportReturnType = "none" # TODO fix one by one From 1948c6bade4b5811626080e79d308e9e0bbd2f38 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Thu, 17 Oct 2024 10:59:19 +0300 Subject: [PATCH 3/4] remove lines --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b5e01db1..ceda386c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,9 +142,6 @@ reportAttributeAccessIssue = "none" # pyright provides false positives reportArgumentType = "none" # pyright provides false positives reportPrivateUsage = "warning" -# reportUnboundVariable = "warning" - -# reportPrivateImportUsage = "none" # -> commented out raises 144 errors reportIndexIssue = "none" # TODO fix one by one reportReturnType = "none" # TODO fix one by one From 5fba608ceb47750729516ff2d7ba60a2a097a280 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas Date: Thu, 17 Oct 2024 11:04:22 +0300 Subject: [PATCH 4/4] undo --- gymnasium/envs/box2d/lunar_lander.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gymnasium/envs/box2d/lunar_lander.py b/gymnasium/envs/box2d/lunar_lander.py index 63ebae816..976647b15 100644 --- a/gymnasium/envs/box2d/lunar_lander.py +++ b/gymnasium/envs/box2d/lunar_lander.py @@ -374,7 +374,7 @@ def reset( # Create Lander body initial_y = VIEWPORT_H / SCALE initial_x = VIEWPORT_W / SCALE / 2 - self.lander = self.world.CreateDynamicBody( + self.lander: Box2D.b2Body = self.world.CreateDynamicBody( position=(initial_x, initial_y), angle=0.0, fixtures=fixtureDef(