math-problem-solve 0.1.1__py3-none-any.whl

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.
@@ -0,0 +1,16 @@
1
+ """One-shot remote problem solving."""
2
+
3
+ from . import solve_main
4
+ from .client import Task, check_connection, solve
5
+ from .exceptions import (
6
+ ConfigurationError,
7
+ EndpointUnavailable,
8
+ ServiceError,
9
+ SolveLMError,
10
+ SolveTimeout,
11
+ )
12
+
13
+ __all__ = [
14
+ "ConfigurationError", "EndpointUnavailable", "ServiceError", "SolveLMError",
15
+ "SolveTimeout", "Task", "check_connection", "solve", "solve_main",
16
+ ]
@@ -0,0 +1,4 @@
1
+ """Set this to the operator's public HTTPS origin before building a release."""
2
+
3
+ DEFAULT_BACKEND_URL: str | None = None
4
+ ENABLE_REMOTE_SOLVING = False
@@ -0,0 +1,187 @@
1
+ """Dependency-free HTTP client."""
2
+
3
+ import json
4
+ import math
5
+ import os
6
+ import re
7
+ from http.client import HTTPException
8
+ from urllib.error import HTTPError, URLError
9
+ from urllib.parse import urlsplit
10
+ from urllib.request import HTTPRedirectHandler, ProxyHandler, Request, build_opener
11
+
12
+ from . import _default
13
+ from ._default import DEFAULT_BACKEND_URL
14
+ from .exceptions import ConfigurationError, EndpointUnavailable, ServiceError, SolveTimeout
15
+
16
+ DEFAULT_TIMEOUT = 115.0
17
+ FALLBACK = 'print("can_help_with_this_task")'
18
+ _MAX_REPLY_BYTES = 8 * 1024 * 1024
19
+ _SECRET_PATTERN = re.compile(r"[A-Za-z0-9._~-]{20,256}")
20
+ _ERRORS = {
21
+ "unauthorized": "Invalid solver passphrase.",
22
+ "auth_limited": "Too many failed authentication attempts. Try later.",
23
+ "rate_limited": "The solver request rate limit was reached.",
24
+ "busy": "All solver slots are busy.",
25
+ "quota_exceeded": "A solver request, token, or spending quota was reached.",
26
+ "invalid_request": "The backend rejected the request. Check the problem and output mode.",
27
+ "request_too_large": "The problem or encoded request exceeds the backend size limit.",
28
+ "body_timeout": "The backend timed out while reading the request.",
29
+ "upstream_error": "OpenAI did not complete the request. Check the backend configuration and provider status.",
30
+ "incomplete": "OpenAI returned an incomplete solution.",
31
+ "refused": "OpenAI declined the task.",
32
+ "empty_output": "OpenAI did not return solution text.",
33
+ "invalid_output": "OpenAI did not return valid Python 3.10 syntax.",
34
+ "photo_invalid": "The backend rejected the photo format, data, or dimensions.",
35
+ "solving_disabled": "Solving has not been enabled on the backend.",
36
+ "quota_unavailable": "The backend could not access its quota database.",
37
+ }
38
+
39
+
40
+ class _NoRedirect(HTTPRedirectHandler):
41
+ def redirect_request(self, req, fp, code, msg, headers, newurl):
42
+ return None
43
+
44
+
45
+ def _origin(backend_url: str | None, *, allow_missing: bool = False) -> str | None:
46
+ value = backend_url if backend_url is not None else (
47
+ os.getenv("MATH_PROBLEM_SOLVE_URL") or DEFAULT_BACKEND_URL
48
+ )
49
+ if value is None and allow_missing:
50
+ return None
51
+ if not value:
52
+ raise ConfigurationError("Set backend_url or MATH_PROBLEM_SOLVE_URL for this release.")
53
+ if any(ord(char) <= 32 or ord(char) == 127 for char in value) or "\\" in value:
54
+ raise ConfigurationError("Invalid backend URL.")
55
+ try:
56
+ parts = urlsplit(value)
57
+ port = parts.port
58
+ except ValueError:
59
+ raise ConfigurationError("Invalid backend URL.") from None
60
+ local = parts.scheme == "http" and parts.hostname in ("127.0.0.1", "::1")
61
+ if (
62
+ not (parts.scheme == "https" or local)
63
+ or not parts.hostname or parts.username is not None or port == 0
64
+ or parts.path not in ("", "/") or "?" in value or "#" in value
65
+ ):
66
+ raise ConfigurationError(
67
+ "Use an HTTPS origin with no path, query, credentials, or fragment. "
68
+ "HTTP is supported for numeric loopback addresses."
69
+ )
70
+ return f"{parts.scheme}://{parts.netloc}"
71
+
72
+
73
+ def _service_error(response: HTTPError) -> Exception:
74
+ status = response.code
75
+ if 300 <= status < 400:
76
+ return EndpointUnavailable("The backend redirected the request. Use its direct HTTPS origin.")
77
+ if status in (504, 524):
78
+ return SolveTimeout("The backend or its proxy timed out. No retry was sent.")
79
+ try:
80
+ payload = json.loads(response.read(4096))
81
+ code = payload.get("code") if isinstance(payload, dict) else None
82
+ except (ValueError, OSError, HTTPException, RecursionError):
83
+ code = None
84
+ if isinstance(code, str) and code in _ERRORS:
85
+ return ServiceError(_ERRORS[code], status=status, code=code)
86
+ if status >= 500:
87
+ return EndpointUnavailable(f"The backend or its proxy returned HTTP {status}.")
88
+ return ServiceError(f"The backend returned HTTP {status}.", status=status, code="http_error")
89
+
90
+
91
+ def _request(origin: str, path: str, timeout: float, body=None, secret=None) -> dict:
92
+ if not math.isfinite(timeout) or timeout <= 0:
93
+ raise ValueError("timeout must be a positive, finite number of seconds.")
94
+ headers = {"Accept": "application/json"}
95
+ data = None
96
+ if body is not None:
97
+ try:
98
+ data = json.dumps(body, ensure_ascii=False).encode("utf-8")
99
+ except UnicodeEncodeError:
100
+ raise ValueError("problem contains invalid Unicode.") from None
101
+ headers["Content-Type"] = "application/json"
102
+ if secret is not None:
103
+ headers["Authorization"] = f"Bearer {secret}"
104
+ request = Request(origin + path, data=data, headers=headers)
105
+ handlers = [_NoRedirect()]
106
+ if origin.startswith("http:"):
107
+ handlers.append(ProxyHandler({}))
108
+ try:
109
+ with build_opener(*handlers).open(request, timeout=timeout) as response:
110
+ raw = response.read(_MAX_REPLY_BYTES + 1)
111
+ except HTTPError as exc:
112
+ with exc:
113
+ error = _service_error(exc)
114
+ raise error from None
115
+ except TimeoutError:
116
+ raise SolveTimeout("The backend request timed out. No retry was sent.") from None
117
+ except URLError as exc:
118
+ if isinstance(exc.reason, TimeoutError):
119
+ raise SolveTimeout("The connection timed out. No retry was sent.") from None
120
+ raise EndpointUnavailable("Could not reach the backend. Check DNS, TLS, and network access.") from None
121
+ except (OSError, EOFError, ValueError, HTTPException):
122
+ raise EndpointUnavailable("The backend connection failed.") from None
123
+ if len(raw) > _MAX_REPLY_BYTES:
124
+ raise EndpointUnavailable("The backend response was too large.")
125
+ try:
126
+ result = json.loads(raw)
127
+ except (ValueError, RecursionError):
128
+ raise EndpointUnavailable("The backend returned invalid JSON.") from None
129
+ if not isinstance(result, dict):
130
+ raise EndpointUnavailable("The backend returned an unexpected response.")
131
+ return result
132
+
133
+
134
+ def check_connection(*, backend_url: str | None = None, timeout: float = 10) -> bool:
135
+ """Check the backend's public health endpoint without authenticating or calling OpenAI."""
136
+ if _request(_origin(backend_url), "/health", timeout) != {"status": "ok"}:
137
+ raise EndpointUnavailable("The endpoint did not return the SolveLM health response.")
138
+ return True
139
+
140
+
141
+ def _validate_secret(secret: str) -> None:
142
+ if not isinstance(secret, str) or not _SECRET_PATTERN.fullmatch(secret):
143
+ raise ValueError("secret must be a 20–256 character URL-safe passphrase.")
144
+
145
+
146
+ def _solution(result: dict) -> str:
147
+ content = result.get("solution")
148
+ if not isinstance(content, str) or not content.strip():
149
+ raise EndpointUnavailable("The backend response did not contain a solution.")
150
+ return content
151
+
152
+
153
+ def solve(
154
+ problem: str, *, secret: str, backend_url: str | None = None,
155
+ timeout: float = DEFAULT_TIMEOUT, mode: str = "code",
156
+ ) -> str:
157
+ """Send one independent task and return its generated code or explanation."""
158
+ if not _default.ENABLE_REMOTE_SOLVING:
159
+ return FALLBACK
160
+ if not isinstance(problem, str) or not problem.strip():
161
+ raise ValueError("problem must be a non-empty string.")
162
+ _validate_secret(secret)
163
+ if mode not in ("code", "explanation"):
164
+ raise ValueError("mode must be 'code' or 'explanation'.")
165
+ return _solution(_request(
166
+ _origin(backend_url), "/solve", timeout, {"problem": problem, "mode": mode}, secret
167
+ ))
168
+
169
+
170
+ class Task:
171
+ """A problem and its client options. Each solve starts a new request."""
172
+
173
+ def __init__(
174
+ self, problem: str, *, secret: str, backend_url: str | None = None,
175
+ timeout: float = DEFAULT_TIMEOUT, mode: str = "code",
176
+ ):
177
+ self.problem = problem
178
+ self._secret = secret
179
+ self.backend_url = backend_url
180
+ self.timeout = timeout
181
+ self.mode = mode
182
+
183
+ def solve(self) -> str:
184
+ return solve(
185
+ self.problem, secret=self._secret, backend_url=self.backend_url,
186
+ timeout=self.timeout, mode=self.mode,
187
+ )
@@ -0,0 +1,26 @@
1
+ """Public client exceptions."""
2
+
3
+
4
+ class SolveLMError(Exception):
5
+ """Base class for service and transport errors."""
6
+
7
+
8
+ class ConfigurationError(SolveLMError):
9
+ """The client has no usable backend URL."""
10
+
11
+
12
+ class EndpointUnavailable(SolveLMError):
13
+ """The backend could not be reached or an intermediary failed."""
14
+
15
+
16
+ class SolveTimeout(SolveLMError):
17
+ """The client or the backend reached its time limit."""
18
+
19
+
20
+ class ServiceError(SolveLMError):
21
+ """The backend rejected the request or could not produce a solution."""
22
+
23
+ def __init__(self, message: str, *, status: int, code: str):
24
+ super().__init__(message)
25
+ self.status = status
26
+ self.code = code
@@ -0,0 +1,87 @@
1
+ """Solve text or read a photo, and save the generated code."""
2
+
3
+ import base64
4
+ import os
5
+ import sys
6
+ from itertools import count
7
+ from pathlib import Path
8
+
9
+ from . import _default
10
+ from .client import DEFAULT_TIMEOUT, FALLBACK, _origin, _request, _SECRET_PATTERN, _solution
11
+ from .exceptions import ServiceError
12
+
13
+ MAX_PHOTO_BYTES = 5 * 1024 * 1024
14
+ _FORMATS = {".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp"}
15
+
16
+
17
+ def _photo(path: str | os.PathLike) -> dict:
18
+ file = Path(path)
19
+ media_type = _FORMATS.get(file.suffix.lower())
20
+ if not media_type:
21
+ raise ValueError("Photo must be PNG, JPEG, or WebP.")
22
+ if not file.is_file():
23
+ raise ValueError("Photo must be an existing regular file.")
24
+ try:
25
+ with file.open("rb") as stream:
26
+ data = stream.read(MAX_PHOTO_BYTES + 1)
27
+ except OSError:
28
+ raise ValueError("Could not read the photo file.") from None
29
+ if not data or len(data) > MAX_PHOTO_BYTES:
30
+ raise ValueError("Photo must be nonempty and at most 5 MiB.")
31
+ return {"image_base64": base64.b64encode(data).decode("ascii"), "image_mime_type": media_type}
32
+
33
+
34
+ def _main_directory() -> Path:
35
+ filename = getattr(sys.modules.get("__main__"), "__file__", None)
36
+ if filename and not filename.startswith("<"):
37
+ return Path(filename).absolute().parent
38
+ return Path.cwd()
39
+
40
+
41
+ def _save(solution: str, folder: Path) -> None:
42
+ for number in count(1):
43
+ path = folder / f"solve{number}.py"
44
+ try:
45
+ stream = path.open("x", encoding="utf-8", newline="\n")
46
+ except FileExistsError:
47
+ continue
48
+ try:
49
+ with stream:
50
+ stream.write(solution)
51
+ except OSError:
52
+ path.unlink(missing_ok=True)
53
+ raise
54
+ return
55
+
56
+
57
+ def _body(task: str | os.PathLike, task_type: str) -> dict:
58
+ if task_type == "photo":
59
+ return _photo(task)
60
+ if task_type != "text":
61
+ raise ValueError("type must be 'text' or 'photo'.")
62
+ if not isinstance(task, str) or not task.strip():
63
+ raise ValueError("Text task must be a non-empty string.")
64
+ return {"problem": task, "mode": "code"}
65
+
66
+
67
+ def solve(
68
+ task: str | os.PathLike, *, type: str = "text", code: str | None = None,
69
+ backend_url: str | None = None, timeout: float = DEFAULT_TIMEOUT,
70
+ output_dir: str | os.PathLike | None = None, save: bool = True,
71
+ ) -> str:
72
+ """Return and save code, or the fallback when solving is unavailable to this caller."""
73
+ folder = Path(output_dir) if output_dir is not None else _main_directory()
74
+ if save and not folder.is_dir():
75
+ raise ValueError("The output directory must already exist.")
76
+ solution = FALLBACK
77
+ if _default.ENABLE_REMOTE_SOLVING and isinstance(code, str) and _SECRET_PATTERN.fullmatch(code):
78
+ origin = _origin(backend_url, allow_missing=True)
79
+ if origin is not None:
80
+ try:
81
+ solution = _solution(_request(origin, "/solve", timeout, _body(task, type), code))
82
+ except ServiceError as exc:
83
+ if exc.code not in ("unauthorized", "auth_limited", "solving_disabled"):
84
+ raise
85
+ if save:
86
+ _save(solution, folder)
87
+ return solution
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.4
2
+ Name: math-problem-solve
3
+ Version: 0.1.1
4
+ Summary: Dependency-free client for a self-hosted one-shot OpenAI text and photo solver
5
+ License-Expression: MIT
6
+ Keywords: openai,programming,mathematics,remote,solver
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Operating System :: OS Independent
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Requires-Python: >=3.10
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Dynamic: license-file
20
+
21
+ # Math Problem Solve
22
+
23
+ ## Что делает текущая сборка
24
+
25
+ В версии 0.1.1 вызов `solve_main.solve(..., code=...)` всегда возвращает
26
+ строку `print("can_help_with_this_task")`. Режим работает сразу после
27
+ установки, без сервера, доступа к OpenAI и расхода токенов.
28
+
29
+ ```bash
30
+ python -m pip install math_problem_solve-0.1.1-py3-none-any.whl
31
+ ```
32
+
33
+ ```python
34
+ from math_problem_solve import solve_main
35
+
36
+ answer = solve_main.solve("Текст задачи", type="text", code="scret")
37
+ print(answer)
38
+ # print("can_help_with_this_task")
39
+ ```
40
+
41
+ Тот же текст сохраняется в первый свободный `solveN.py` рядом с
42
+ запускаемым `main.py`. При интерактивном запуске используется текущая
43
+ папка. Готовые файлы не перезаписываются. Чтобы выбрать другую
44
+ существующую папку, передай `output_dir=...`. Если нужен только результат
45
+ в памяти, передай `save=False`. Для фото синтаксис тот же:
46
+
47
+ ```python
48
+ answer = solve_main.solve("фото задачи.png", type="photo", code="scret")
49
+ ```
50
+
51
+ Сборка поддерживает Python 3.10+ без клиентских зависимостей.
52
+
53
+ ## Как потом задать код и включить решение
54
+
55
+ 1. Создай приватный `.env` на сервере командой
56
+ `.venv/bin/python scripts/configure.py`. Она оставит решение выключенным.
57
+ Укажи в своём локальном редакторе `SOLVELM_SOLVE_CODE` и новый
58
+ `OPENAI_API_KEY`. Код доступа должен содержать 20–256 символов из
59
+ латиницы, цифр, точки, дефиса, подчёркивания или тильды.
60
+ Храни оба значения только на сервере. Пользователю передавай только
61
+ код доступа, который он будет указывать в `code=...`.
62
+ 2. В том же файле установи `SOLVELM_SOLVING_ENABLED=true` и перезапусти
63
+ сервер. Прежняя настройка публичного доступа больше не используется.
64
+ 3. В клиентском файле `src/math_problem_solve/_default.py` установи
65
+ `ENABLE_REMOTE_SOLVING = True` и `DEFAULT_BACKEND_URL` равным
66
+ публичному HTTPS-адресу. Укажи адрес без ключей и кода доступа.
67
+ Собери новую версию пакета. В текущей сборке удалённые вызовы выключены
68
+ даже при переданном адресе.
69
+
70
+ После включения незаданный или неверный код возвращает ту же заглушку.
71
+ При верном коде и доступной квоте один вызов отправляет в OpenAI один
72
+ независимый запрос. Файл результата создаётся только на клиенте и
73
+ автоматически не запускается. Рабочий режим поддерживает PNG, JPEG и WebP
74
+ до 5 МиБ и 16 млн пикселей. Ошибка связи с включённым сервером сообщается
75
+ отдельно.
76
+
77
+ Общие лимиты по умолчанию составляют 6 вызовов в скользящую минуту,
78
+ 60 в сутки, 2 одновременно, 1 млн токенов и расчётные 10 USD в месяц.
79
+ Сутки и месяц считаются по UTC. Значения можно снизить в `.env`.
80
+ Для фото до отправки резервируется 32 тыс. токенов изображения, затем
81
+ запись обновляется по фактическим данным ответа. Это локальная оценка
82
+ бюджета. Итоговый счёт OpenAI может отличаться.
83
+
84
+ Чтобы проверить доступность сервера без обращения к OpenAI:
85
+
86
+ ```python
87
+ from math_problem_solve import check_connection
88
+ print(check_connection(backend_url="https://solver.example.com"))
89
+ ```
90
+
91
+ ## Постоянный HTTPS, когда MacBook закрыт
92
+
93
+ Размести **серверную часть** на постоянно работающем Ubuntu VPS, например
94
+ DigitalOcean Droplet. PyPI раздаёт клиентскую библиотеку. GitHub для этого
95
+ варианта не нужен: серверный архив копируется на VPS по SSH. Понадобятся
96
+ аккаунт у облачного провайдера, бюджет на VPS и домен или поддомен.
97
+
98
+ 1. Создай Ubuntu 24.04 LTS VPS с SSH-ключом. Укажи в DNS A-запись
99
+ `solver.твой-домен`, которая ведёт на публичный IPv4 VPS. Открой 80 и 443
100
+ для Caddy. Порт 22 оставь доступным только для администрирования, порт 8765
101
+ наружу не открывай.
102
+ 2. Передай на VPS полный архив, подставив свои имя пользователя и адрес.
103
+
104
+ ```bash
105
+ scp math_problem_solve-0.1.1-source.zip admin@SERVER_IP:~/
106
+ ssh admin@SERVER_IP
107
+ ```
108
+
109
+ 3. Подготовь сервис и установи зависимости. Команды ниже выполняются на VPS
110
+ из домашней папки администратора.
111
+
112
+ ```bash
113
+ sudo apt update
114
+ sudo apt install -y python3-venv curl unzip caddy
115
+ unzip math_problem_solve-0.1.1-source.zip
116
+ sudo useradd --system --user-group --home-dir /opt/math-problem-solve --shell /usr/sbin/nologin mathsolver
117
+ sudo install -d -m 0750 -o mathsolver -g mathsolver /opt/math-problem-solve
118
+ sudo cp -R math_problem_solve/. /opt/math-problem-solve/
119
+ sudo chown -R mathsolver:mathsolver /opt/math-problem-solve
120
+ cd /opt/math-problem-solve
121
+ sudo -u mathsolver python3 -m venv .venv
122
+ sudo -u mathsolver .venv/bin/python -m pip install -r backend/requirements.txt
123
+ sudo -u mathsolver .venv/bin/python scripts/configure.py
124
+ sudo -u mathsolver mkdir -m 700 .state
125
+ ```
126
+
127
+ Введи новый OpenAI Project API key в скрытом запросе. Если ключ уже
128
+ появлялся в переписке, отзови его и выпусти новый. Открой `.env` командой
129
+ `sudo -u mathsolver nano .env` и установи `SOLVELM_ORIGIN_MODE=proxy`.
130
+ Включай решение только после установки кода и лимитов по шагам выше.
131
+ Сохрани файл. Для локальной проверки без прокси оставь режим `local` и
132
+ запусти `.venv/bin/python -m backend` из папки проекта.
133
+
134
+ 4. Замени `solver.example.com` на свой DNS-адрес в `deploy/Caddyfile` и запусти
135
+ сервисы. Команда с `install` для Caddy предназначена для нового выделенного
136
+ VPS. Если Caddy уже обслуживает сайты, добавь этот блок в существующую
137
+ конфигурацию.
138
+
139
+ ```bash
140
+ sudo install -m 0644 deploy/math-problem-solve.service /etc/systemd/system/
141
+ sudo install -m 0644 deploy/Caddyfile /etc/caddy/Caddyfile
142
+ sudo caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
143
+ sudo systemctl daemon-reload
144
+ sudo systemctl enable --now math-problem-solve caddy
145
+ sudo systemctl reload caddy
146
+ ```
147
+
148
+ 5. С другого подключения проверь публичный адрес командой
149
+ `curl -fsS https://solver.example.com/health`. Затем проверь один короткий
150
+ запрос после настройки нового ключа и лимита расходов. Сервис
151
+ автоматически стартует после перезагрузки VPS. Для переноса на другой
152
+ VPS можно сохранить тот же домен и обновить DNS.
153
+
154
+ [Создание VPS](https://docs.digitalocean.com/products/droplets/how-to/create/),
155
+ [настройка сетевого экрана](https://docs.digitalocean.com/products/networking/firewalls/how-to/create/),
156
+ [HTTPS в Caddy](https://caddyserver.com/docs/automatic-https),
157
+ [OpenAI Responses API для изображений](https://developers.openai.com/api/docs/guides/images-vision?api-mode=responses).
158
+
159
+ ## TestPyPI и PyPI
160
+
161
+ Нужны два отдельных аккаунта, TestPyPI для проверки и PyPI для обычного
162
+ `pip install`. На каждом используй собственный токен публикации.
163
+ Эти аккаунты нужны владельцу пакета. Пользователю библиотеки достаточно pip
164
+ и доступа по HTTPS к серверу. PyPI и TestPyPI вернули 404 для
165
+ `math-problem-solve` при проверке 6 декабря 2026 года. Имя остаётся
166
+ незарезервированным до первой загрузки.
167
+
168
+ Перед публикацией рабочего клиента впиши URL и включи удалённые вызовы в `src/math_problem_solve/_default.py`.
169
+ Из чистой папки проекта:
170
+
171
+ ```bash
172
+ python -m pip install -e .
173
+ python -m pip install -r backend/requirements.txt pytest build twine
174
+ python -m pytest -q
175
+ python -m build
176
+ python -m twine check 'dist/*'
177
+ python scripts/check_artifacts.py dist
178
+ ```
179
+
180
+ Для тестовой загрузки после одобрения:
181
+
182
+ ```bash
183
+ python -m twine upload --repository testpypi dist/math_problem_solve-0.1.1*
184
+ python -m venv .venv-testpypi
185
+ .venv-testpypi/bin/python -m pip install --index-url https://test.pypi.org/simple/ --no-deps --only-binary=:all: math_problem_solve==0.1.1
186
+ .venv-testpypi/bin/python -c 'from math_problem_solve import check_connection; print(check_connection())'
187
+ ```
188
+
189
+ После проверки и отдельного одобрения загрузить **те же** архивы на основной
190
+ PyPI. При запросе имени пользователя Twine укажи `__token__`, токен введи как
191
+ пароль в терминале.
192
+
193
+ ```bash
194
+ python -m twine upload --repository pypi dist/math_problem_solve-0.1.1*
195
+ python -m pip install --no-deps --only-binary=:all: math_problem_solve==0.1.1
196
+ ```
197
+
198
+ Версия находится в `pyproject.toml`. После загрузки для изменения файлов
199
+ нужно выпустить новую версию. На Windows путь к интерпретатору в виртуальном
200
+ окружении — `Scripts/python.exe`.
201
+ [Руководство по TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/).
@@ -0,0 +1,10 @@
1
+ math_problem_solve/__init__.py,sha256=GegHT-RawLU2BHAvTRjZoBJADfrI77UL_DfW53MgD1Q,413
2
+ math_problem_solve/_default.py,sha256=Cle6cbP80H68XprjLYYKjTPVV7y68mxohgPRsrDqosE,150
3
+ math_problem_solve/client.py,sha256=WwOeCgHW_qXbcOWsG1_NAO1_zfGOhA--auP-hMPKPX8,8116
4
+ math_problem_solve/exceptions.py,sha256=fL_-s30CXgO3C17LlxaQYkcb3Uuq7ka9XwPlz3rxlAc,685
5
+ math_problem_solve/solve_main.py,sha256=ih4qHeA4TgLyDd3andJm19zeUQqepM6g_KMkQrhrUZ0,3240
6
+ math_problem_solve-0.1.1.dist-info/licenses/LICENSE,sha256=98qfpeFLWhDtF9PfNblNWBhsSvwojqHMbiG55Gvr0wo,1077
7
+ math_problem_solve-0.1.1.dist-info/METADATA,sha256=YYdMbEGMZ5ODoCYyBknVCy-iwFCC3xFbP-25cAh3Hsg,12085
8
+ math_problem_solve-0.1.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
9
+ math_problem_solve-0.1.1.dist-info/top_level.txt,sha256=PwslZcmTMkN04u6_ui2gPrzN4osAYYh8EyFBQ3RORHw,19
10
+ math_problem_solve-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SolveLM contributors
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 @@
1
+ math_problem_solve