Skip to main content

A realtime debugging and testing plugin for Palantir's Python Language Server.

Project description

A realtime debugging and testing plugin for Palantir’s Python Language Server (pyls).

Who is it for?

Anyone who creates/maintains projects in Python.

Why?

Debugging and testing tends to be fairly separate from editing code. Typically a developer needs to run tests each time changes are made and a file saved, and start a debug session when a non-obvious error is found. This slows down the development process considerably.

This plugin uses features provided by the language server protocol (LSP) - as implemented in pyls - to run tests and provide debugging data* whenever code is updated, making the debug+test feedback process realtime.

How can I start using it?

  • Install pyls into an IDE with LSP support (instructions).

  • Install pyls-livepy into pyls, specifying the “pyls” extra.
    pip install pyls-livepy[pyls]
  • Ensure your project has a pyproject.toml file created with poetry.

  • Install pyls-livepy into the project, specifying the “runs” extra.
    poetry add --dev pyls-livepy[runs]
  • Install nox (with toml) so it can be ran from within the project (globally is recommended).

  • Open a Python project file in the editor to ensure pyls-livepy is detected, and to generate the nox config.

  • Run nox at least once to create the project’s environment.

  • Write doctests and pytest cases** as you write your code; any failing/throwing tests will be marked.

  • To disable per project, create a file called disable-pyls-livepy in the project’s root folder.

What is the (default) expected behavior?

In addition to making debugging and testing easier, this plugin also aims to promote the use of modern methods and tools for working with Python projects. It can be configured for other tools, but no configuration is required when nox, poetry and pytest are used. By default, the plugin:

  • Creates a noxfile.py in the project or a pyls-livepy session is added if one exists (once a project file is accessed).

  • Uses poetry to install the project into an existing nox environment.

  • Runs tests on every syntatically correct change.

  • Indicates failing/exception-throwing tests via LSP diagnostic markers.

Where can I find more information?

Further documentation is a work in progress.

Notes

  • Due to the fact that this plugin must be installed into the project, and it was created for Python v3.7, the project must also use minimum 3.7.

  • * Debug data view functionality has not yet been implemented (as of v0.1.0).

  • ** Individual pytest cases can also be ran by importing run_pytest_case from pyls_livepy and passing a CLI string that selects a test, within the doctest. The test file name MUST be the name of the tested module prepended by “test_”, and the module MUST be imported at the global level.

  • This project has been set up using PyScaffold 3.2.3. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

pyls-livepy-0.2.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

pyls_livepy-0.2.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file pyls-livepy-0.2.0.tar.gz.

File metadata

  • Download URL: pyls-livepy-0.2.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-47-generic

File hashes

Hashes for pyls-livepy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ed03fb7bf1257cfbb6c2414e6f393238dde9297cf5be8388104bba340b53b790
MD5 4475a5b520207aaf34cc51023a83242a
BLAKE2b-256 99877d201bd8351ca8c5999a620d6de707a7675abd45582c403529ce2fdad6f5

See more details on using hashes here.

File details

Details for the file pyls_livepy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyls_livepy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-47-generic

File hashes

Hashes for pyls_livepy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa51e7a684acc219de2a82f92554fdde638afb8f9f392d2b998aaef9e6be17b5
MD5 a9d19ff8f496d28af093b14132649ee3
BLAKE2b-256 03d3ee1dc80b21ff579a325bc884d59dfd4d3d1e49736a6c5fa0583e73d1a118

See more details on using hashes here.

Supported by

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