Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baize build uses deprecated pdm.pep517.api backend #72

Open
nieder opened this issue Feb 17, 2025 · 6 comments
Open

baize build uses deprecated pdm.pep517.api backend #72

nieder opened this issue Feb 17, 2025 · 6 comments
Labels
good first issue Good for newcomers

Comments

@nieder
Copy link

nieder commented Feb 17, 2025

When building baize-0.22.2, I get this error:

* Building wheel...

Traceback (most recent call last):
  File "/sw/share/bootstrap-modules-python38/pyproject_hooks/_impl.py", line 402, in _call_hook
    raise BackendUnavailable(
pyproject_hooks._impl.BackendUnavailable: Cannot import 'pdm.pep517.api'

ERROR Backend 'pdm.pep517.api' is not available.

But looking at pdm-pep517, it shows that is now called pdm-backend

@abersheeran
Copy link
Owner

PR welcome 🙂

@abersheeran abersheeran added the good first issue Good for newcomers label Feb 17, 2025
@nieder
Copy link
Author

nieder commented Feb 17, 2025

Might have worked it, but it's failing a bunch of tests like this:

_____________________________________________________________________ test_request_response _____________________________________________________________________

    @pytest.mark.asyncio
    async def test_request_response():
        @request_response
        async def view(request: Request) -> Response:
            return PlainTextResponse(await request.body)
    
>       async with httpx.AsyncClient(app=view, base_url="http://testServer/") as client:
E       TypeError: __init__() got an unexpected keyword argument 'app'

tests/test_asgi.py:1225: TypeError
________________________________________________________________________ test_decorator _________________________________________________________________________

    @pytest.mark.asyncio
    async def test_decorator():
        @decorator
        async def decorator_func(
            request: Request, handler: Callable[[Request], Awaitable[Response]]
        ) -> Response:
            response = await handler(request)
            response.headers["X-Middleware"] = "1"
            return response
    
        @request_response
        @decorator_func
        async def view(request: Request) -> Response:
            return PlainTextResponse(await request.body)
    
>       async with httpx.AsyncClient(app=view, base_url="http://testServer/") as client:
E       TypeError: __init__() got an unexpected keyword argument 'app'

tests/test_asgi.py:1262: TypeError

I don't think this is because I switched the build backend. Ideas? I want to make sure it passes tests before doing the PR

@abersheeran
Copy link
Owner

Because you updated the version of httpx, the usage of app= has been deleted in the new version of httpx.

@nieder
Copy link
Author

nieder commented Feb 18, 2025

Thanks for that detail. But I thought I had a compatible version of httpx. pyproject.toml says httpx between 0.19.0 and 1.0.0. I have 0.28.1:

$ python3.8
Python 3.8.13 (default, Jan 14 2023, 05:56:25) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import httpx
>>> print(httpx.__version__)
0.28.1

@abersheeran
Copy link
Owner

httpx made some breaking changes. I thought maybe you could fix the tests as well?

@nieder
Copy link
Author

nieder commented Feb 19, 2025

I don't even know where to begin for that fix. I looked at httpx and httpx.Client takes I think 1 argument, but that gives me an error and this is not my area, unfortunately.

https://github.com/encode/httpx/blob/26d48e0634e6ee9cdc0533996db289ce4b430177/docs/api.md?plain=1#L38-L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants