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.10.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.10-py2.py3-none-any.whl (30.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: nrepl_python-0.3.10.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.10.tar.gz
Algorithm Hash digest
SHA256 4699fa5777114db9ffc95ac69d773d4265d46f751cb403a23ff9a6aedf318d09
MD5 bf374d74d3b98636a1bdca929381156e
BLAKE2b-256 42c3ee196f0ffad645abd325505d3039fd45e3cca4419453ddd5eedc61bd39a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nrepl_python-0.3.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 33e23815244887150a59ef60929d3e87979455fffcd5490d3a95cd3605f13870
MD5 39a49844cd92d97dba0ca343d3f86aa0
BLAKE2b-256 0f135b2c2443d8ae8d4283ae07a90e76066df1f4e9367f39088cb8af5982d4bc

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