mcp-abacus 0.1.0__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.
- mcp_abacus-0.1.0/.github/FUNDING.yml +11 -0
- mcp_abacus-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +25 -0
- mcp_abacus-0.1.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
- mcp_abacus-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- mcp_abacus-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- mcp_abacus-0.1.0/.github/workflows/ci.yml +37 -0
- mcp_abacus-0.1.0/.github/workflows/release.yml +45 -0
- mcp_abacus-0.1.0/.gitignore +26 -0
- mcp_abacus-0.1.0/CONTRIBUTING.md +56 -0
- mcp_abacus-0.1.0/LICENSE +674 -0
- mcp_abacus-0.1.0/PKG-INFO +113 -0
- mcp_abacus-0.1.0/README.md +97 -0
- mcp_abacus-0.1.0/TODO +1236 -0
- mcp_abacus-0.1.0/pyproject.toml +45 -0
- mcp_abacus-0.1.0/run-tests.sh +40 -0
- mcp_abacus-0.1.0/src/mcp_abacus/__init__.py +11 -0
- mcp_abacus-0.1.0/src/mcp_abacus/__main__.py +15 -0
- mcp_abacus-0.1.0/src/mcp_abacus/expr/__init__.py +37 -0
- mcp_abacus-0.1.0/src/mcp_abacus/expr/lexer.py +182 -0
- mcp_abacus-0.1.0/src/mcp_abacus/expr/nodes.py +309 -0
- mcp_abacus-0.1.0/src/mcp_abacus/expr/parser.py +173 -0
- mcp_abacus-0.1.0/src/mcp_abacus/expr/reference.py +118 -0
- mcp_abacus-0.1.0/src/mcp_abacus/expr/value.py +1627 -0
- mcp_abacus-0.1.0/src/mcp_abacus/server.py +348 -0
- mcp_abacus-0.1.0/tests/conftest.py +359 -0
- mcp_abacus-0.1.0/tests/test_e2e.py +424 -0
- mcp_abacus-0.1.0/tests/test_evaluate.py +237 -0
- mcp_abacus-0.1.0/tests/test_functions.py +797 -0
- mcp_abacus-0.1.0/tests/test_info.py +39 -0
- mcp_abacus-0.1.0/tests/test_lexer.py +277 -0
- mcp_abacus-0.1.0/tests/test_nodes.py +216 -0
- mcp_abacus-0.1.0/tests/test_package.py +29 -0
- mcp_abacus-0.1.0/tests/test_parser.py +425 -0
- mcp_abacus-0.1.0/tests/test_reference.py +67 -0
- mcp_abacus-0.1.0/tests/test_server.py +387 -0
- mcp_abacus-0.1.0/tests/test_value.py +1006 -0
- mcp_abacus-0.1.0/uv.lock +1247 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# GitHub Sponsors / funding configuration.
|
|
2
|
+
# This enables the "Sponsor" button on the repository.
|
|
3
|
+
# Sponsorship tiers (and their perks) are configured in the GitHub Sponsors
|
|
4
|
+
# dashboard, not in this file.
|
|
5
|
+
|
|
6
|
+
github: [laszlopere]
|
|
7
|
+
|
|
8
|
+
# Other funding platforms are also supported, e.g.:
|
|
9
|
+
# ko_fi: your_kofi_name
|
|
10
|
+
# liberapay: your_liberapay_name
|
|
11
|
+
# custom: ["https://example.com/donate"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report something that doesn't work as expected
|
|
4
|
+
title: ""
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**What happened**
|
|
10
|
+
A clear description of the bug.
|
|
11
|
+
|
|
12
|
+
**What you expected**
|
|
13
|
+
What you expected to happen instead.
|
|
14
|
+
|
|
15
|
+
**Reproduction**
|
|
16
|
+
A minimal expression, mode, and tool call that triggers it.
|
|
17
|
+
|
|
18
|
+
**Environment**
|
|
19
|
+
- mcp-abacus version: <!-- the installed version, e.g. `pip show mcp-abacus` / `uv tool list` -->
|
|
20
|
+
- Python version: <!-- `python --version` -->
|
|
21
|
+
- Mode(s): <!-- e.g. floating-point / rational / fixed-point / signed-integer-64 -->
|
|
22
|
+
- OS: <!-- e.g. Ubuntu 24.04 -->
|
|
23
|
+
|
|
24
|
+
**Logs / output**
|
|
25
|
+
Any relevant error output (please redact secrets).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an improvement or a new capability
|
|
4
|
+
title: ""
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ""
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**The problem**
|
|
10
|
+
What are you trying to do that's hard or impossible today?
|
|
11
|
+
|
|
12
|
+
**Proposed solution**
|
|
13
|
+
What you'd like to see — a new mode, operator, function, or behavior change.
|
|
14
|
+
|
|
15
|
+
**Alternatives considered**
|
|
16
|
+
Other approaches you've thought about, including workarounds with the existing
|
|
17
|
+
modes and expression language.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Anything else relevant (the numeric mode, an example expression, links).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!-- Thanks for contributing to mcp-abacus! -->
|
|
2
|
+
|
|
3
|
+
**What this changes**
|
|
4
|
+
A short description of the change and why.
|
|
5
|
+
|
|
6
|
+
**Related issues**
|
|
7
|
+
Closes #<!-- issue number -->, if applicable.
|
|
8
|
+
|
|
9
|
+
**Checklist**
|
|
10
|
+
- [ ] `ruff check .` and `ruff format --check .` pass
|
|
11
|
+
- [ ] `mypy` passes
|
|
12
|
+
- [ ] `pytest` passes
|
|
13
|
+
- [ ] Docs/README updated if behavior or tools changed
|
|
14
|
+
- [ ] New modes/operators/functions stay type-faithful and consistent across the numeric regimes where relevant
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v6
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v7
|
|
21
|
+
|
|
22
|
+
- name: Install the project
|
|
23
|
+
# Let uv manage a project venv; installing into the runner's system
|
|
24
|
+
# Python fails under PEP 668 (externally managed).
|
|
25
|
+
run: uv sync --all-extras --python ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Lint (ruff)
|
|
28
|
+
run: uv run ruff check .
|
|
29
|
+
|
|
30
|
+
- name: Format check (ruff)
|
|
31
|
+
run: uv run ruff format --check .
|
|
32
|
+
|
|
33
|
+
- name: Type-check (mypy)
|
|
34
|
+
run: uv run mypy
|
|
35
|
+
|
|
36
|
+
- name: Test (pytest)
|
|
37
|
+
run: uv run pytest -v
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishes to PyPI via Trusted Publishing (OIDC) on a version tag, e.g. v0.2.0.
|
|
4
|
+
# No API tokens are stored: PyPI verifies the GitHub OIDC identity instead.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags: ["v*"]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v7
|
|
17
|
+
|
|
18
|
+
- name: Build sdist and wheel
|
|
19
|
+
run: uv build
|
|
20
|
+
|
|
21
|
+
- name: Check distributions
|
|
22
|
+
run: uvx twine check dist/*
|
|
23
|
+
|
|
24
|
+
- name: Upload dist artifact
|
|
25
|
+
uses: actions/upload-artifact@v4
|
|
26
|
+
with:
|
|
27
|
+
name: dist
|
|
28
|
+
path: dist/
|
|
29
|
+
|
|
30
|
+
publish:
|
|
31
|
+
needs: build
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
# The trusted publisher on PyPI is bound to this environment name.
|
|
34
|
+
environment: pypi
|
|
35
|
+
permissions:
|
|
36
|
+
id-token: write # required for OIDC
|
|
37
|
+
steps:
|
|
38
|
+
- name: Download dist artifact
|
|
39
|
+
uses: actions/download-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: dist
|
|
42
|
+
path: dist/
|
|
43
|
+
|
|
44
|
+
- name: Publish to PyPI
|
|
45
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Byte-compiled / optimized
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
.eggs/
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
|
|
16
|
+
# Test / tooling caches
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.ruff_cache/
|
|
19
|
+
.mypy_cache/
|
|
20
|
+
.coverage
|
|
21
|
+
htmlcov/
|
|
22
|
+
|
|
23
|
+
# Editors
|
|
24
|
+
.idea/
|
|
25
|
+
.vscode/
|
|
26
|
+
*.swp
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Contributing to mcp-abacus
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in improving **mcp-abacus**! Contributions of all kinds
|
|
4
|
+
are welcome — bug reports, feature requests, docs, and code.
|
|
5
|
+
|
|
6
|
+
## Where things live
|
|
7
|
+
|
|
8
|
+
- Source: [`github.com/laszlopere/mcp-abacus`](https://github.com/laszlopere/mcp-abacus)
|
|
9
|
+
- Issues & feature requests: <https://github.com/laszlopere/mcp-abacus/issues>
|
|
10
|
+
- Package source lives under `src/mcp_abacus/`; tests under `tests/`.
|
|
11
|
+
|
|
12
|
+
## Development setup
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
python -m venv .venv && . .venv/bin/activate
|
|
16
|
+
pip install -e ".[dev]"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or with [uv](https://docs.astral.sh/uv/):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv pip install -e ".[dev]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Checks before opening a PR
|
|
26
|
+
|
|
27
|
+
The CI runs these on Python 3.10–3.13; please run them locally first:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
ruff check . # lint
|
|
31
|
+
ruff format --check . # formatting
|
|
32
|
+
mypy # type-check (src/)
|
|
33
|
+
pytest # unit tests (or ./run-tests.sh for a per-failure summary)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Guidelines
|
|
37
|
+
|
|
38
|
+
- **Type-faithfulness matters.** Every result must be bit-for-bit what the
|
|
39
|
+
selected numeric regime (fixed-width int, IEEE-754 float, fixed-point, decimal,
|
|
40
|
+
rational) actually produces — never an approximation that "looks right."
|
|
41
|
+
- **`Value` is the single chokepoint for type behavior.** Adding a numeric type
|
|
42
|
+
is a local, two-step change — add its member to the mode enum, then implement
|
|
43
|
+
that member's branch in each operation in `value.py`. The rest of the engine is
|
|
44
|
+
generic over the enum and never branches on type itself; keep it that way.
|
|
45
|
+
- Match the surrounding code style — type hints, no stray `type: ignore`.
|
|
46
|
+
- Update the README when you add or change a tool, mode, operator, or function.
|
|
47
|
+
|
|
48
|
+
## Reporting bugs
|
|
49
|
+
|
|
50
|
+
Use the issue templates. Please include your mcp-abacus version, Python version,
|
|
51
|
+
the numeric mode(s) involved, and a minimal expression that reproduces the issue.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
By contributing, you agree that your contributions are licensed under the
|
|
56
|
+
project's [GNU General Public License v3.0 or later](LICENSE).
|