django / daphne

Django Channels HTTP/WebSocket server
BSD 3-Clause "New" or "Revised" License
2.32k stars 256 forks source link

Fix package missing management folder(#508) #509

Open 1One0 opened 2 months ago

1One0 commented 2 months ago

In setup.cfg

packages = find: was changed to

packages =
    daphne    
    twisted.plugins

When manually list packages, should enumerate all the packages

packages =
    daphne
    daphne.management
    twisted.plugins
carltongibson commented 2 months ago

Thanks for this @1One0

commands is a package too no?

I was wondering if we could fix the find: by setting package_dirs 🤔 (Looking at the daphne-4.1.x-py3-none-any.whl/daphne-4.1.x.dist-info/top_level.txt in the wheel is what differs from 4.0)

carltongibson commented 2 months ago

Screenshot 2024-04-11 at 11 32 32

Built wheel missing the commands package. We could add that as well, but I'd rather fix the find:.

1One0 commented 2 months ago

What about add a extra daphne.management.commands?

Or move the dir /daphne/twisted/plugin to /twisted/plugin then can easily use:

package_dir =
packages =find:

The problem is hard to change top-level with setup.cfg, it will be easier when use setup.py.

carltongibson commented 2 months ago

Another take on this in #510.

If you checkout the branch you can python -m build and then inspect the wheel to see both the twisted plugin and the Daphne subpackages picked up.

1One0 commented 2 months ago

oh i see, and this problem is exist earlier, it happend when changefind: I will try to find a way to fix that...

carltongibson commented 2 months ago

@1One0 I think #510 is correct no? Can you test to confirm?