cookiecutter / cookiecutter-django

Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
https://cookiecutter-django.readthedocs.io
BSD 3-Clause "New" or "Revised" License
12.02k stars 2.88k forks source link

Replace deprecated `uvicorn.workers` with `uvicorn-worker` #5110

Closed jasonmokk closed 3 months ago

jasonmokk commented 4 months ago

Description

This PR replaces all references to the deprecated uvicorn.workers module in favor of uvicorn-worker.

Closes #5109

Checklist:

Rationale

foarsitter commented 4 months ago

@jasonmokk, did you test this change in your local environment?

jasonmokk commented 4 months ago

@jasonmokk, did you test this change in your local environment?

Yes, all tests are passing locally.

Screenshot 2024-05-31 at 11 58 47 Screenshot 2024-05-31 at 12 00 35
foarsitter commented 4 months ago

Your modification isn't covered by the test-suite. I can tell you right away this wont work because you didn't install the package and your worker class contains an hyphen, which is not allowed in Python.

jasonmokk commented 4 months ago

Thank you for the feedback. I installed the uvicorn-worker package locally and added it to requirements/base.txt. I also corrected the worker class name to uvicorn_worker. My apologies for the misunderstanding with the generated project tests, this time I correctly used Docker on my Mac machine and tests are passing.

browniebroke commented 4 months ago

The automated test suite of the generated project isn't covering uvicorn either, it's only used when starting the server with the unicorn commands, in the files that you changed.

browniebroke commented 3 months ago

Thanks for the contribution!