Skip to main content

Pyre linting plugin for pylsp

Project description

python-lsp-pyre

Implements support for calling Meta's Pyre type checker via a subprocess.

This is a plugin for the Python LSP Server.

It was written to scratch an itch, so may not be quite what you're looking for.

Installation

To use this plugin, you need to install this plugin in the same virtualenv as python-lsp-server itself.

pip install python-lsp-pyre

or to make it a development requirement in Poetry

poetry add -G dev python-lsp-pyre

Then run python-lsp-server as usual, the plugin will be auto-discovered by python-lsp-server if you've installed it to the right environment. Refer to python-lsp-server and your IDE/text editor documentation on how to setup python-lsp-server. An example is provided for KDE's Kate editor.

Configuration

Meta's Pyre uses .pyre_configuration files in your project to set up lint controls. It does not read pyproject.toml.

On first run of this plugin, it will detect a missing .pyre_configuration, and write out one for you. It relies on the workspace root passed to the language server for this write. This file is not immutable, and the reference documentation may be useful.

You can also use pyre init instead to set up the configuration.

The configuration written by this plugin is:

{
    "site_package_search_strategy": "all",
    "source_directories": [
        "."
    ],
    "exclude": [
        "/setup.py",
        ".*/build/.*"
    ]
}

The noteable difference from pyre init is the change to the search strategy (pep561 to all).

Features

This plugin adds the following features to pylsp:

  • Type linting via Meta's Pyre (pyre-check)

Developing

Install development dependencies with (you might want to create a virtualenv first):

git clone https://github.com/cricalix/python-lsp-pyre python-lsp-pyre
cd python-lsp-pyre
pip install -e '.[dev]'

Alterately, if you use Poetry,

poetry install

will set up a virtualenv if necessary, install all dependencies, and then install this project in editable/development mode.

Project details


Download files

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

Source Distribution

python_lsp_pyre-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

python_lsp_pyre-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file python_lsp_pyre-0.1.1.tar.gz.

File metadata

  • Download URL: python_lsp_pyre-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for python_lsp_pyre-0.1.1.tar.gz
Algorithm Hash digest
SHA256 137c976a7c8fbecd5214f6a07e189c99e3d4ad6e41b4edf4af60468c06ac2dbe
MD5 31d5332c3ffff4a287f5eefd0ea5c555
BLAKE2b-256 ffca5abbd3c0e69dd7048c88f784b4617a5632f58dcf1eb42632a39e780e5fa9

See more details on using hashes here.

File details

Details for the file python_lsp_pyre-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_lsp_pyre-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62932f65236db7c218c2f4556541605495f1cd569d343e88aa7c8ed8aa4146ad
MD5 1e442f1eebccfaf922a7fc9e7bb3bd29
BLAKE2b-256 5a45df04fdc900e4ca7afe8a5b0c8e15aaef3f457ae31d39182316c8af3e1416

See more details on using hashes here.

Supported by

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