Skip to main content

A realtime debugging and testing plugin for the Python Language Server (pylsp).

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 pylsp - 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 pylsp into an IDE with LSP support (instructions).

  • Install pyls-livepy into pylsp, 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/.

Metadata

Release files for pyls-livepy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyls-livepy 0.3.0
File Size Uploaded
pyls-livepy-0.3.0.tar.gz 24.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyls-livepy 0.3.0
File Interpreter ABI Platform
pyls_livepy-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.1 kB

Release files / pyls-livepy-0.3.0.tar.gz

Download URL pyls-livepy-0.3.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9e29a65a84d5b4add1ec2f52dc2502a5c51bafe023fb69fa149b4a027f5d0e09
BLAKE2b-256 checksum
How to use checksums
8374d85fb0dd5efbbbc5eff2cccb780bc764b6763d375fd3ff47ab50ccd6d8ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.9.1 Linux/5.4.0-67-generic

Release files / pyls_livepy-0.3.0-py3-none-any.whl

Download URL pyls_livepy-0.3.0-py3-none-any.whl
Size 26.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
453e354bc757032ecd749ea606d336e1e2bd80d6db401f6ea3213499282fb4c2
BLAKE2b-256 checksum
How to use checksums
2194ec5af5408696d6a2429a30754cb6690a34ff7466c1f724dd8ca266946fb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.7 CPython/3.9.1 Linux/5.4.0-67-generic

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page