diff --git a/docker/dockerfile.worker b/docker/dockerfile.worker index fc14640..a62b264 100644 --- a/docker/dockerfile.worker +++ b/docker/dockerfile.worker @@ -1,4 +1,4 @@ -FROM python:3.6 +FROM python:3.10 ADD requirements.txt /app/requirements.txt ADD ./setup.py /app/setup.py diff --git a/docker/dockerfile.www b/docker/dockerfile.www index c585d61..e2a33a3 100644 --- a/docker/dockerfile.www +++ b/docker/dockerfile.www @@ -1,4 +1,4 @@ -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7 +FROM ghcr.io/multi-py/python-uvicorn:py3.10-slim-LATEST # Put first so anytime this file changes other cached layers are invalidated. COPY ./requirements.txt /app/requirements.txt diff --git a/githuborganizer/tasks/github.py b/githuborganizer/tasks/github.py index 2a21cfc..6a62768 100644 --- a/githuborganizer/tasks/github.py +++ b/githuborganizer/tasks/github.py @@ -1,6 +1,6 @@ -from githuborganizer import celery import githuborganizer.models.gh as gh -from githuborganizer.services.github import ghapp, get_organization_client +from githuborganizer import celery +from githuborganizer.services.github import get_organization_client, ghapp @celery.task(rate_limit='4/h', max_retries=0) @@ -13,9 +13,11 @@ def process_installs(synchronous = False): if synchronous: update_organization_settings(organization) update_organization_teams(organization) + update_organization_team_members(organization) else: update_organization_settings.delay(organization) update_organization_teams.delay(organization) + update_organization_team_members.delay(organization) @celery.task(max_retries=0) diff --git a/githuborganizer/www.py b/githuborganizer/www.py index 2b6179f..77411f9 100644 --- a/githuborganizer/www.py +++ b/githuborganizer/www.py @@ -1,7 +1,10 @@ +from typing import Any, Dict + from fastapi import FastAPI -from typing import Dict, Any from starlette.requests import Request + import githuborganizer.tasks.github as tasks +from githuborganizer.services.github import ghapp app = FastAPI() @@ -61,7 +64,9 @@ def installation_payload(payload): install_id = payload['installation']['id'] install = ghapp.get_installation(install_id) organization = install.get_organization() - update_organization_settings.delay(organization) + tasks.update_organization_settings.delay(organization) + tasks.update_organization_teams.delay(organization) + tasks.update_organization_team_members.delay(organization) return 'Processing organization %s.' % organization diff --git a/setup.py b/setup.py index 382e111..d016cf9 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,9 @@ # Always prefer setuptools over distutils -from setuptools import setup, find_packages # To use a consistent encoding from codecs import open +from setuptools import find_packages, setup + version = '0.1.0' try: @@ -41,14 +42,14 @@ install_requires=[ 'Beaker>=1.11.0,<2', - 'celery>=4.1,<5', + 'celery>=5,6', 'click>=7.0,<8.0', - 'cryptography>=2.1.4,<3', + 'cryptography>=2.1.4', 'github3.py>=1,<2', 'github3apps.py>=0.2.0,<0.3', - 'pyjwt>=1.5.3,<2', - 'PyYAML>=5,<6', - 'fastapi>=0.42.0', + 'pyjwt>=2,<3', + 'PyYAML>=6,<7', + 'fastapi>=0.75.0', ], extras_require={