Skip to content

Commit

Permalink
Merge pull request #158 from reef-technologies/ruff-format
Browse files Browse the repository at this point in the history
Add ruff autoformatting to nox lint and format sessions
  • Loading branch information
vbaltrusaitis-reef authored Feb 27, 2024
2 parents ffc495f + bf05db2 commit 23e7446
Show file tree
Hide file tree
Showing 21 changed files with 294 additions and 280 deletions.
10 changes: 5 additions & 5 deletions {{cookiecutter.repostory_name}}/app/envs/prod/gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from prometheus_client import multiprocess
{% endif %}
workers = 2 * multiprocessing.cpu_count() + 1
bind = '0.0.0.0:8000'
wsgi_app = '{{ cookiecutter.django_project_name }}.wsgi:application'
access_logfile = '-'
bind = "0.0.0.0:8000"
wsgi_app = "{{ cookiecutter.django_project_name }}.wsgi:application"
access_logfile = "-"


{% if cookiecutter.monitoring == "y" %}
{% if cookiecutter.monitoring == "y" -%}
def child_exit(server, worker):
multiprocess.mark_process_dead(worker.pid)
{% endif %}
{%- endif %}
4 changes: 2 additions & 2 deletions {{cookiecutter.repostory_name}}/app/src/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{cookiecutter.django_project_name}}.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{cookiecutter.django_project_name}}.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
Expand All @@ -16,5 +16,5 @@ def main():
execute_from_command_line(sys.argv)


if __name__ == '__main__':
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{cookiecutter.django_project_name}}.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{cookiecutter.django_project_name}}.settings")

application = get_asgi_application()
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
{%- if cookiecutter.monitoring == "y" %}
from prometheus_client import multiprocess
{% endif %}
os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{{cookiecutter.django_project_name}}.settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{cookiecutter.django_project_name}}.settings")

app = Celery('{{cookiecutter.django_project_name}}')
app = Celery("{{cookiecutter.django_project_name}}")

app.config_from_object('django.conf:settings', namespace='CELERY')
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)


def route_task(name, args, kwargs, options, task=None, **kw):
return {'queue': 'celery'}
return {"queue": "celery"}
{% if cookiecutter.monitoring == "y" %}

@worker_process_shutdown.connect
Expand Down
Loading

0 comments on commit 23e7446

Please sign in to comment.