Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cashu/wallet/auth/openid_connect/openid_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ async def handle_callback(self, request: Request) -> HTMLResponse:
if "error_description" in params:
error_str += f": {params['error_description']}"
return self.templates.TemplateResponse(
request,
"error.html",
{"request": request, "error": error_str},
{"error": error_str},
)
elif "code" in params and "state" in params:
code: str = params["code"]
Expand All @@ -154,8 +155,9 @@ async def handle_callback(self, request: Request) -> HTMLResponse:
return response
else:
return self.templates.TemplateResponse(
request,
"error.html",
{"request": request, "error": "Missing 'code' or 'state' parameter"},
{"error": "Missing 'code' or 'state' parameter"},
)

async def exchange_code_for_token(self, code: str) -> Dict[str, Any]:
Expand Down Expand Up @@ -352,8 +354,8 @@ def render_success_page(
self, request: Request, token_data: Dict[str, Any]
) -> HTMLResponse:
"""Render an HTML page with a green check mark and user information."""
context = {"request": request, "token_data": token_data}
return self.templates.TemplateResponse("success.html", context)
context = {"token_data": token_data}
return self.templates.TemplateResponse(request, "success.html", context)

async def authenticate_with_device_code(self) -> None:
"""Authenticate using the device code flow."""
Expand Down
22 changes: 11 additions & 11 deletions cashu/wallet/v1_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from posixpath import join
from typing import List, Optional, Tuple, Union
from typing import Any, List, Optional, Tuple, Union

import bolt11
import httpx
Expand Down Expand Up @@ -66,7 +66,6 @@ def async_set_httpx_client(func):

async def wrapper(self, *args, **kwargs):
# set proxy
proxies_dict = {}
proxy_url: Union[str, None] = None
if settings.tor and TorProxy().check_platform():
self.tor = TorProxy(timeout=True)
Expand All @@ -76,18 +75,19 @@ async def wrapper(self, *args, **kwargs):
proxy_url = f"socks5://{settings.socks_proxy}"
elif settings.http_proxy:
proxy_url = settings.http_proxy
if proxy_url:
proxies_dict.update({"all://": proxy_url})

headers_dict = {"Client-version": settings.version}

self.httpx = httpx.AsyncClient(
verify=not settings.debug,
proxies=proxies_dict, # type: ignore
headers=headers_dict,
base_url=self.url.rstrip("/"),
timeout=None if settings.debug else 60,
)
client_kwargs: dict[str, Any] = {
"verify": not settings.debug,
"headers": headers_dict,
"base_url": self.url.rstrip("/"),
"timeout": None if settings.debug else 60,
}
if proxy_url:
client_kwargs["proxy"] = proxy_url

self.httpx = httpx.AsyncClient(**client_kwargs)
return await func(self, *args, **kwargs)

return wrapper
Expand Down
1,595 changes: 879 additions & 716 deletions poetry.lock

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,52 @@ python = "^3.10"
SQLAlchemy = {version = "^2.0.35", extras = ["asyncio"]}
greenlet = ">=3.0.0"
click = "^8.1.7"
pydantic = "^2.5.3"
pydantic-settings = "^2.1.0"
pydantic = "^2.13.4"
pydantic-settings = "^2.14.2"
bech32 = "^1.2.0"
fastapi = "^0.115.0"
environs = "^9.5.0"
uvicorn = "^0.31.0"
fastapi = "^0.139.0"
environs = "^15.0.1"
uvicorn = "^0.49.0"
loguru = "^0.7.0"
ecdsa = "^0.19.0"
ecdsa = "^0.19.2"
bitstring = "^3.1.9"
h11 = "^0.14.0"
cryptography = "^43.0.1"
h11 = "^0.16.0"
cryptography = "^49.0.0"
websocket-client = "^1.3.3"
pycryptodomex = "^3.16.0"
setuptools = "^75.1.0"
wheel = "^0.41.1"
setuptools = "^82.0.1"
wheel = "^0.47.0"
importlib-metadata = "^6.8.0"
httpx = {extras = ["socks"], version = "^0.25.1"}
httpx = {extras = ["socks"], version = "^0.28.1"}
bip32 = "^4.0"
mnemonic = "^0.20"
bolt11 = "^2.0.5"
websockets = "^12.0"
slowapi = "^0.1.9"
cbor2 = "^5.6.2"
cbor2 = "^6.1.2"
asyncpg = "^0.30.0"
aiosqlite = "^0.20.0"
grpcio = "^1.65.1"
googleapis-common-protos = "^1.63.2"
mypy-protobuf = "^3.6.0"
types-protobuf = "^5.27.0.20240626"
grpcio-tools = "^1.65.1"
pyjwt = "^2.9.0"
grpcio = "^1.81.1"
googleapis-common-protos = "^1.75.0"
mypy-protobuf = "^5.1.0"
types-protobuf = "^7.34.1.20260518"
grpcio-tools = "^1.81.1"
pyjwt = "^2.13.0"
redis = "^5.1.1"
brotli = "^1.1.0"
brotli = "^1.2.0"
zstandard = "^0.23.0"
jinja2 = "^3.1.5"
jinja2 = "^3.1.6"
breez-sdk-spark = "^0.15.0"

[tool.poetry.group.dev.dependencies]
pytest-asyncio = "^0.24.0"
pytest-cov = "^6.0.0"
pytest = "^8.3.3"
pytest-asyncio = "^1.4.0"
pytest-cov = "^7.1.0"
pytest = "^9.1.1"
fastapi-profiler = "^1.4.1"
respx = "^0.21.1"
respx = "^0.23.1"
ruff = "^0.7.1"
mypy = "^1.13.0"
pre-commit = "^4.0.1"
pre-commit = "^4.6.0"
types-redis = "^4.6.0"
hypothesis = "^6.150.0"

Expand Down
67 changes: 36 additions & 31 deletions requirements.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether we could simplify this by just reconciling pyproject.toml ↔ requirements.txt using the Makefile's package target

package:
	poetry export -f requirements.txt --without-hashes --output requirements.txt
	make clean
	python setup.py sdist bdist_wheel

Or maybe just create another target if we only want a minimal export command

requirements:
	poetry export -f requirements.txt --without-hashes --output requirements.txt

package: requirements
	$(MAKE) clean
	python setup.py sdist bdist_wheel

.PHONY: requirements package

I may be misunderstanding the intent behind this manual update — could you clarify? IMO this shouldn't be committed at all if it can be generated during the setup/packaging process.

Original file line number Diff line number Diff line change
@@ -1,64 +1,69 @@
aiosqlite==0.20.0 ; python_version >= "3.10" and python_version < "4.0"
annotated-doc==0.0.4 ; python_version >= "3.10" and python_version < "4.0"
annotated-types==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
anyio==4.8.0 ; python_version >= "3.10" and python_version < "4.0"
asn1crypto==1.5.1 ; python_version >= "3.10" and python_version < "4.0"
async-timeout==5.0.1 ; python_version >= "3.10" and python_full_version < "3.11.3"
asyncpg==0.30.0 ; python_version >= "3.10" and python_version < "4.0"
backports-datetime-fromisoformat==2.0.3 ; python_version == "3.10"
base58==2.1.1 ; python_version >= "3.10" and python_version < "4.0"
bech32==1.2.0 ; python_version >= "3.10" and python_version < "4.0"
bip32==4.0 ; python_version >= "3.10" and python_version < "4.0"
bitstring==3.1.9 ; python_version >= "3.10" and python_version < "4.0"
bolt11==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
brotli==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
cbor2==5.6.5 ; python_version >= "3.10" and python_version < "4.0"
brotli==1.2.0 ; python_version >= "3.10" and python_version < "4.0"
cbor2==6.1.2 ; python_version >= "3.10" and python_version < "4.0"
certifi==2024.12.14 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.17.1 ; python_version >= "3.10" and python_version < "4.0"
cffi==2.0.0 ; python_version >= "3.10" and python_version < "4.0"
click==8.1.8 ; python_version >= "3.10" and python_version < "4.0"
coincurve==20.0.0 ; python_version >= "3.10" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32")
cryptography==43.0.3 ; python_version >= "3.10" and python_version < "4.0"
cryptography==49.0.0 ; python_version >= "3.10" and python_version < "4.0"
deprecated==1.2.15 ; python_version >= "3.10" and python_version < "4.0"
ecdsa==0.19.0 ; python_version >= "3.10" and python_version < "4.0"
environs==9.5.0 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11"
fastapi==0.115.6 ; python_version >= "3.10" and python_version < "4.0"
googleapis-common-protos==1.66.0 ; python_version >= "3.10" and python_version < "4.0"
ecdsa==0.19.2 ; python_version >= "3.10" and python_version < "4.0"
environs==15.0.1 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version == "3.10"
fastapi==0.139.0 ; python_version >= "3.10" and python_version < "4.0"
googleapis-common-protos==1.75.0 ; python_version >= "3.10" and python_version < "4.0"
greenlet==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
grpcio-tools==1.69.0 ; python_version >= "3.10" and python_version < "4.0"
grpcio==1.69.0 ; python_version >= "3.10" and python_version < "4.0"
h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.7 ; python_version >= "3.10" and python_version < "4.0"
httpx[socks]==0.25.2 ; python_version >= "3.10" and python_version < "4.0"
idna==3.10 ; python_version >= "3.10" and python_version < "4.0"
grpcio-tools==1.81.1 ; python_version >= "3.10" and python_version < "4.0"
grpcio==1.81.1 ; python_version >= "3.10" and python_version < "4.0"
h11==0.16.0 ; python_version >= "3.10" and python_version < "4.0"
httpcore==1.0.9 ; python_version >= "3.10" and python_version < "4.0"
httpx==0.28.1 ; python_version >= "3.10" and python_version < "4.0"
idna==3.18 ; python_version >= "3.10" and python_version < "4.0"
importlib-metadata==6.11.0 ; python_version >= "3.10" and python_version < "4.0"
jinja2==3.1.5 ; python_version >= "3.10" and python_version < "4.0"
jinja2==3.1.6 ; python_version >= "3.10" and python_version < "4.0"
limits==4.0.1 ; python_version >= "3.10" and python_version < "4.0"
loguru==0.7.3 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "4.0"
marshmallow==3.25.1 ; python_version >= "3.10" and python_version < "4.0"
marshmallow==4.3.0 ; python_version >= "3.10" and python_version < "4.0"
mnemonic==0.20 ; python_version >= "3.10" and python_version < "4.0"
mypy-protobuf==3.6.0 ; python_version >= "3.10" and python_version < "4.0"
mypy-protobuf==5.1.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==24.2 ; python_version >= "3.10" and python_version < "4.0"
protobuf==5.29.3 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.10" and python_version < "4.0"
protobuf==6.33.6 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.10" and python_version < "4.0" and implementation_name != "PyPy"
pycryptodomex==3.21.0 ; python_version >= "3.10" and python_version < "4.0"
pydantic==1.10.21 ; python_version >= "3.10" and python_version < "4.0"
pyjwt==2.10.1 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.10" and python_version < "4.0"
pydantic-core==2.46.4 ; python_version >= "3.10" and python_version < "4.0"
pydantic-settings==2.14.2 ; python_version >= "3.10" and python_version < "4.0"
pydantic==2.13.4 ; python_version >= "3.10" and python_version < "4.0"
pyjwt==2.13.0 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.2.2 ; python_version >= "3.10" and python_version < "4.0"
redis==5.2.1 ; python_version >= "3.10" and python_version < "4.0"
secp256k1==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
setuptools==75.8.0 ; python_version >= "3.10" and python_version < "4.0"
setuptools==82.0.1 ; python_version >= "3.10" and python_version < "4.0"
six==1.17.0 ; python_version >= "3.10" and python_version < "4.0"
slowapi==0.1.9 ; python_version >= "3.10" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
socksio==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy[asyncio]==2.0.37 ; python_version >= "3.10" and python_version < "4.0"
starlette==0.41.3 ; python_version >= "3.10" and python_version < "4.0"
types-protobuf==5.29.1.20241207 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
uvicorn==0.31.1 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy==2.0.37 ; python_version >= "3.10" and python_version < "4.0"
starlette==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
types-protobuf==7.34.1.20260518 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.16.0 ; python_version >= "3.10" and python_version < "4.0"
typing-inspection==0.4.2 ; python_version >= "3.10" and python_version < "4.0"
uvicorn==0.49.0 ; python_version >= "3.10" and python_version < "4.0"
websocket-client==1.8.0 ; python_version >= "3.10" and python_version < "4.0"
websockets==12.0 ; python_version >= "3.10" and python_version < "4.0"
wheel==0.41.3 ; python_version >= "3.10" and python_version < "4.0"
wheel==0.47.0 ; python_version >= "3.10" and python_version < "4.0"
win32-setctime==1.2.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
wrapt==1.17.2 ; python_version >= "3.10" and python_version < "4.0"
zipp==3.21.0 ; python_version >= "3.10" and python_version < "4.0"
Expand Down
Loading
Loading