Skip to content

Commit

Permalink
Drop Pyright in favor of just mypy.
Browse files Browse the repository at this point in the history
Pyright has been more trouble than it's worth.

Update vscode config accordingly (including for devcontainer).
  • Loading branch information
jab committed Dec 29, 2022
1 parent 84b1bdc commit e5849e2
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 33 deletions.
14 changes: 5 additions & 9 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
// ARGS set in ./Dockerfile can be overridden here:
"args": {}
},
// Set *default* container specific settings.json values on container create.
// Default, container-specific settings here are set on container create.
// Note: The project's .vscode/settings.json is still the right place
// for non-container-specific settings.
"settings": {
// Enable pylance's pyright integration (disabled by default):
"python.analysis.typeCheckingMode": "strict",
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pylintEnabled": false,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
Expand All @@ -26,10 +23,9 @@
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.testing.pytestEnabled": true,
"esbonio.sphinx.confDir": "${workspaceFolder}/docs",
"restructuredtext.pythonRecommendation.disabled": true,
"terminal.integrated.defaultProfile.linux": "fish",
"terminal.integrated.defaultProfile.linux": "fish"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
Expand All @@ -43,7 +39,7 @@
"ms-python.vscode-pylance",
"mutantdino.resource-monitor",
"tamasfe.even-better-toml",
"trond-snekvik.simple-rst",
"trond-snekvik.simple-rst"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally by default.
// (Even without this, by default VS Code will notice when a process starts listening on an
Expand Down
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ repos:
- id: codespell
args: ["--uri-ignore-words-list", "*"] # https://github.com/codespell-project/codespell/issues/2473

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.285
hooks:
- id: pyright

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
Expand Down
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// vim: set ft=json5
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
"recommendations": [
"charliermarsh.ruff",
// "tamasfe.even-better-toml",
// "lextudio.restructuredtext",
// "trond-snekvik.simple-rst",
],
"unwantedRecommendations": [],
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// vim: set ft=json5
{
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
// Prefer mypy over Pyright:
"python.analysis.typeCheckingMode": "off",
"python.linting.mypyEnabled": true,
"python.testing.pytestEnabled": true,
}
2 changes: 1 addition & 1 deletion bidict/_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def iteritems_mapping_or_iterable(arg: MapOrIterItems[KT, VT]) -> IterItems[KT, VT]:
"""Yield the items in *arg* based on whether it's a mapping."""
yield from arg.items() if isinstance(arg, t.Mapping) else arg # pyright: ignore
yield from arg.items() if isinstance(arg, t.Mapping) else arg


def iteritems(__arg: MapOrIterItems[KT, VT], **kw: VT) -> IterItems[KT, VT]:
Expand Down
1 change: 0 additions & 1 deletion docs/thanks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Projects
- `Sphinx <https://www.sphinx-doc.org>`__
- `Readthedocs <https://readthedocs.org>`__
- `mypy <https://mypy.readthedocs.io>`__
- `pyright <https://github.com/microsoft/pyright>`__
- `ruff <https://github.com/charliermarsh/ruff>`__
- `Flake8 <https://flake8.pycqa.org>`__
- `Pylint <https://www.pylint.org>`__
Expand Down
17 changes: 0 additions & 17 deletions pyrightconfig.json

This file was deleted.

0 comments on commit e5849e2

Please sign in to comment.