leanclient 0.1.0b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- leanclient-0.1.0b1/LICENSE +21 -0
- leanclient-0.1.0b1/PKG-INFO +92 -0
- leanclient-0.1.0b1/README.md +73 -0
- leanclient-0.1.0b1/leanclient/__init__.py +4 -0
- leanclient-0.1.0b1/leanclient/client.py +994 -0
- leanclient-0.1.0b1/leanclient/file_client.py +111 -0
- leanclient-0.1.0b1/leanclient/pool.py +143 -0
- leanclient-0.1.0b1/leanclient/utils.py +58 -0
- leanclient-0.1.0b1/pyproject.toml +28 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Oliver Dressler
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: leanclient
|
|
3
|
+
Version: 0.1.0b1
|
|
4
|
+
Summary: Interact with the Lean theorem prover language server
|
|
5
|
+
Home-page: https://github.com/oOo0oOo/leanclient
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: Oliver Dressler
|
|
8
|
+
Author-email: hey@oli.show
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Dist: orjson (>=3.10.13,<4.0.0)
|
|
17
|
+
Project-URL: Repository, https://github.com/oOo0oOo/leanclient
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# leanclient
|
|
21
|
+
|
|
22
|
+
leanclient is a thin wrapper around the native Lean language server.
|
|
23
|
+
It enables interaction with a Lean language server instance running in a subprocess.
|
|
24
|
+
|
|
25
|
+
Check out the [documentation](https://leanclient.readthedocs.io) for more information.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Key Features
|
|
29
|
+
|
|
30
|
+
- **Interact**: Query and change lean files via the [LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)
|
|
31
|
+
- **Thin wrapper**: Directly expose the [Lean Language Server](https://github.com/leanprover/lean4/tree/master/src/Lean/Server).
|
|
32
|
+
- **Synchronous**: Requests block until a response is received.
|
|
33
|
+
- **Fast**: Typically more than 99% of time is spent waiting.
|
|
34
|
+
- **Parallel**: Easy batch processing of files using all your cores.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Currently in Beta
|
|
38
|
+
|
|
39
|
+
**Not compatible** with Lean 4.15.0 (stable) yet.
|
|
40
|
+
|
|
41
|
+
- The API is almost stable.
|
|
42
|
+
- There are missing features.
|
|
43
|
+
- Needs more testing with different setups.
|
|
44
|
+
- Any feedback is appreciated!
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Next Features
|
|
48
|
+
|
|
49
|
+
- Documentation: Tutorial & examples
|
|
50
|
+
- Publishing on pipy
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Potential Features
|
|
54
|
+
|
|
55
|
+
- Virtual files (no actual file on disk), only in-memory in lsp and client
|
|
56
|
+
- Use document versions to handle evolving file states
|
|
57
|
+
- Automatic lean env setup for non Debian-based systems
|
|
58
|
+
- Parallel implementation (multiple requests in-flight) like [multilspy](https://github.com/microsoft/multilspy/)
|
|
59
|
+
- Allow interaction before `waitForDiagnostics` returns
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Missing LSP Methods
|
|
63
|
+
|
|
64
|
+
Might be implemented in the future:
|
|
65
|
+
- `callHierarchy/incomingCalls`, `callHierarchy/outgoingCalls`, ...
|
|
66
|
+
- `$/lean/rpc/connect`, `$/lean/rpc/call`, `$/lean/rpc/release`, `$/lean/rpc/keepAlive`
|
|
67
|
+
- `workspace/symbol`, `workspace/didChangeWatchedFiles`, `workspace/applyEdit`, ...
|
|
68
|
+
- `textDocument/prepareRename`, `textDocument/rename`
|
|
69
|
+
- `$/lean/ileanInfoUpdate`, `$/lean/ileanInfoFinal`, `$/lean/importClosure`, `$/lean/staleDependency`
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Run Tests
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# python3 -m venv venv # Or similar: Create environment
|
|
76
|
+
make install # Installs python package and dev dependencies
|
|
77
|
+
make test # Run all tests, also installs fresh lean env if not found
|
|
78
|
+
make test-profile # Run all tests with cProfile
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
Read the documentation at [leanclient.readthedocs.io](https://leanclient.readthedocs.io).
|
|
84
|
+
|
|
85
|
+
Run ``make docs`` to build the documentation locally.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|
|
91
|
+
|
|
92
|
+
Citing this repository is highly appreciated but not required by the license.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# leanclient
|
|
2
|
+
|
|
3
|
+
leanclient is a thin wrapper around the native Lean language server.
|
|
4
|
+
It enables interaction with a Lean language server instance running in a subprocess.
|
|
5
|
+
|
|
6
|
+
Check out the [documentation](https://leanclient.readthedocs.io) for more information.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Key Features
|
|
10
|
+
|
|
11
|
+
- **Interact**: Query and change lean files via the [LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)
|
|
12
|
+
- **Thin wrapper**: Directly expose the [Lean Language Server](https://github.com/leanprover/lean4/tree/master/src/Lean/Server).
|
|
13
|
+
- **Synchronous**: Requests block until a response is received.
|
|
14
|
+
- **Fast**: Typically more than 99% of time is spent waiting.
|
|
15
|
+
- **Parallel**: Easy batch processing of files using all your cores.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Currently in Beta
|
|
19
|
+
|
|
20
|
+
**Not compatible** with Lean 4.15.0 (stable) yet.
|
|
21
|
+
|
|
22
|
+
- The API is almost stable.
|
|
23
|
+
- There are missing features.
|
|
24
|
+
- Needs more testing with different setups.
|
|
25
|
+
- Any feedback is appreciated!
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Next Features
|
|
29
|
+
|
|
30
|
+
- Documentation: Tutorial & examples
|
|
31
|
+
- Publishing on pipy
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Potential Features
|
|
35
|
+
|
|
36
|
+
- Virtual files (no actual file on disk), only in-memory in lsp and client
|
|
37
|
+
- Use document versions to handle evolving file states
|
|
38
|
+
- Automatic lean env setup for non Debian-based systems
|
|
39
|
+
- Parallel implementation (multiple requests in-flight) like [multilspy](https://github.com/microsoft/multilspy/)
|
|
40
|
+
- Allow interaction before `waitForDiagnostics` returns
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Missing LSP Methods
|
|
44
|
+
|
|
45
|
+
Might be implemented in the future:
|
|
46
|
+
- `callHierarchy/incomingCalls`, `callHierarchy/outgoingCalls`, ...
|
|
47
|
+
- `$/lean/rpc/connect`, `$/lean/rpc/call`, `$/lean/rpc/release`, `$/lean/rpc/keepAlive`
|
|
48
|
+
- `workspace/symbol`, `workspace/didChangeWatchedFiles`, `workspace/applyEdit`, ...
|
|
49
|
+
- `textDocument/prepareRename`, `textDocument/rename`
|
|
50
|
+
- `$/lean/ileanInfoUpdate`, `$/lean/ileanInfoFinal`, `$/lean/importClosure`, `$/lean/staleDependency`
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Run Tests
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# python3 -m venv venv # Or similar: Create environment
|
|
57
|
+
make install # Installs python package and dev dependencies
|
|
58
|
+
make test # Run all tests, also installs fresh lean env if not found
|
|
59
|
+
make test-profile # Run all tests with cProfile
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
Read the documentation at [leanclient.readthedocs.io](https://leanclient.readthedocs.io).
|
|
65
|
+
|
|
66
|
+
Run ``make docs`` to build the documentation locally.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
|
72
|
+
|
|
73
|
+
Citing this repository is highly appreciated but not required by the license.
|