Browse Source

make into python package

Dennis Chen 2 years ago
parent
commit
648eb03643

+ 1 - 1
Dockerfile

@@ -23,4 +23,4 @@ RUN apk add --no-cache --update --virtual .build-deps \
  && apk del .fetch-deps
 
 COPY . .
-CMD [ "gunicorn", "-w", "4", "app:app" ]
+CMD [ "gunicorn", "-w", "4", "aces:app" ]

+ 1 - 0
aces/__init__.py

@@ -0,0 +1 @@
+from .app import app

+ 4 - 4
app.py

@@ -25,10 +25,10 @@ from flask_login import (
 from sr_auth import Credential, DefaultApi, Response
 
 
-from forms import LoginForm, UploadForm
-from models import Advisor, Event, Student, User
-from settings import cache, custom_settings, login_manager, pool
-from worker import xlsx_worker
+from .forms import LoginForm, UploadForm
+from .models import Advisor, Event, Student, User
+from .settings import cache, custom_settings, login_manager, pool
+from .worker import xlsx_worker
 
 login_manager.login_view = 'login'
 login_manager.login_message_category = 'error'

forms.py → aces/forms.py


+ 1 - 1
models.py

@@ -2,7 +2,7 @@
 
 from flask_login import UserMixin
 
-from settings import cache, custom_settings, pool
+from .settings import cache, custom_settings, pool
 
 
 class User(UserMixin):

settings.py → aces/settings.py


static/app.css → aces/static/app.css


static/app.js → aces/static/app.js


templates/admin.html → aces/templates/admin.html


templates/advisor.html → aces/templates/advisor.html


templates/components/students_table.html → aces/templates/components/students_table.html


templates/event.html → aces/templates/event.html


templates/index.html → aces/templates/index.html


templates/layout.html → aces/templates/layout.html


templates/leaderboard.html → aces/templates/leaderboard.html


templates/login.html → aces/templates/login.html


templates/status.html → aces/templates/status.html


templates/student_index.html → aces/templates/student_index.html


templates/upload.html → aces/templates/upload.html


uploads/.gitkeep → aces/uploads/.gitkeep


+ 1 - 1
worker.py

@@ -4,7 +4,7 @@ from os.path import basename
 
 from openpyxl import load_workbook
 
-from settings import pool
+from .settings import pool
 
 # Excel Column Constants
 ADV_EMAIL = 0

+ 28 - 0
setup.py

@@ -0,0 +1,28 @@
+"""aces setup module."""
+
+from setuptools import setup, find_packages
+
+
+setup(
+    name='aces',
+    version='0.0.0',
+    description='ACE Status Checker',
+    url='https://src-code.simons-rock.edu/git/ACES/aces',
+    author='Dennis Chen',
+    author_email='barracks510@gmail.com',
+
+    classifiers=[
+        'Development Status :: 3 - Alpha',
+        'Programming Language :: Python :: 3.6',
+    ],
+
+    packages=find_packages(exclude=['resources', 'docs', 'tests']),
+    # To provide executable scripts, use entry points in preference to the
+    # "scripts" keyword. Entry points provide cross-platform support and allow
+    # pip to create the appropriate form of executable for the target platform.
+    entry_points={
+        'console_scripts': [
+            'aces-dev-server=aces:app.run',
+        ],
+    },
+)