Skip to main content

NREPL server for Python

Project description

NREPL Python

This is an implementation of the [https://nrepl.org/nrepl/1.3/index.html][NREPL] protocol for the Python programming language.

For now, the built-in operations that are implemented are:

  • add-middleware ⁃ clone ⁃ describe ⁃ eval
  • interrupt
  • ls-middleware ⁃ ls-sessions ⁃ load-file
  • swap-middleware

The following built-in operations are not yet implemented:

  • stdin

The following built-in operations are not planned to be implemented:

  • complete
  • lookup

The rationale is that LSP does completion and lookup correctly for Python, and NREPL in pythonspace is here to provide an super extensible evaluation server, rather than try to replace LSP's mature features. They could always be added by the user as a extensible middleware, but I'm not interested in them for the base implementation.

Differencies with NREPL

This server tries to comply as close as possible to NREPL, but still has a few key differences. Contrary to NREPL :

  • this server implementation makes a use of external packages, in particular bencode.py, gevent and ipython.
  • Middleware are classes (and not higher-level functions) regrouping business logic. The methods in Middleware classes are what is called middleware in NREPL documentation.
  • We use a direct acyclic graph instead of a list when resolving requirements and dependencies of loaded middleware.

Usage

python-nrepl-server or python -m nrepl.server

Development

guix shell -L channel -m manifest.scm --rebuild-cache -- python -m nrepl.server

To test it out, I'm using [https://git.sr.ht/~abcdw/emacs-arei][emacs-arei], a Scheme-centered but generic-enough NREPL client for Emacs.

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

nrepl_python-0.3.8.tar.gz (91.9 kB view details)

Uploaded Source

Built Distribution

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

nrepl_python-0.3.8-py2.py3-none-any.whl (30.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nrepl_python-0.3.8.tar.gz.

File metadata

  • Download URL: nrepl_python-0.3.8.tar.gz
  • Upload date:
  • Size: 91.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for nrepl_python-0.3.8.tar.gz
Algorithm Hash digest
SHA256 d10ac6029ab3e89bff93208e1bce164e0a3ffdc0788165c5af860680b4cb6892
MD5 6d872fe9f9fb19c74903a08dc89a6326
BLAKE2b-256 1ccbf84468efab52b6d58010efdadbcce99dec3c746ba54acad5e72eece132da

See more details on using hashes here.

File details

Details for the file nrepl_python-0.3.8-py2.py3-none-any.whl.

File metadata

  • Download URL: nrepl_python-0.3.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for nrepl_python-0.3.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3b2ec08417124831ed77ed56c393412c7af0878777d5ebf9e2dfa1fe1af05d0f
MD5 8517b8e56a392f04beb9cccac8a8f74c
BLAKE2b-256 efb4c63803eb49de803715a1df847fe7eb9c2d75cace59672548dd15bce850b0

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