Skip to main content

Static type checking and language server for Python 2.7 — an unofficial py2 fork of basedpyright (the tool runs on Python 3.8+; it type-checks and provides IDE features for Python 2 code).

Project description

basedpy2right

Static type checking and a Language Server (LSP) for Python 2.7 — an unofficial "necromancy" fork of basedpyright that teaches the analyzer Python 2's grammar (print statements, old-style classes, StringIO/ConfigParser/… stdlib) and ships a bundled Python-2.7 typeshed so a 2.7 codebase gets modern editor tooling today.

The distribution is named basedpy2right, but the console scripts are deliberately left as basedpyright / basedpyright-langserver so the stock basedpyright VS Code extension drives this fork with no extra configuration.

Install

pip install basedpy2right

This pulls nodejs-wheel-binaries (the tool runs a bundled JS analyzer under a managed Node runtime — no global Node install is added to your PATH).

Quick usage

Command line (point it at your Python 2.7 interpreter):

basedpyright --pythonversion 2.7 your_module.py
# or, to resolve installed 2.7 site-packages too:
basedpyright --pythonpath /path/to/python2.7 your_project/

The bundled Python-2.7 typeshed is auto-selected when you analyze at pythonVersion 2.7 — no typeshedPath configuration required.

VS Code: install the basedpyright extension and select your Python 2.7 interpreter; the language server provides hover, go-to-definition, reveal_type, and diagnostics for 2.7 code.

Disclaimer / attribution

This is an unofficial Python-2.7 fork. It is not affiliated with, endorsed by, or supported by basedpyright / detachhead, or pyright / Microsoft.

Based on basedpyright by detachhead, which is based on pyright by Microsoft. Distributed under the MIT License; upstream copyright and license are preserved in LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basedpy2right-1.39.9.24-py3-none-any.whl (13.6 MB view details)

Uploaded Python 3

File details

Details for the file basedpy2right-1.39.9.24-py3-none-any.whl.

File metadata

File hashes

Hashes for basedpy2right-1.39.9.24-py3-none-any.whl
Algorithm Hash digest
SHA256 406537f31a6292f434e4bc4b0eb6771221cb71cdbc671e012bd07ad9fb86522a
MD5 a83a0836fada81902620bca06bf9a17f
BLAKE2b-256 69c629c303e47b866b594aa164b9d8a7ed8a89d935dbd75bfc5b9fe8407d556b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page