Skip to content

Upgrade / Spring Cleaning #30

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.6
FROM python:3.10

ADD requirements.txt /app/requirements.txt
ADD ./setup.py /app/setup.py
Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfile.www
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 4 additions & 2 deletions githuborganizer/tasks/github.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions githuborganizer/www.py
Original file line number Diff line number Diff line change
@@ -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()

Expand Down Expand Up @@ -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


Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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={
Expand Down