Skip to content

Commit 131481c

Browse files
authored
Fix docker build error (#101)
1 parent e69cfaf commit 131481c

7 files changed

Lines changed: 115 additions & 10 deletions

File tree

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
__pycache__/
2+
.cache/
3+
venv/
4+
5+
.envrc
6+
.env
7+
*.pyc
8+
*.db
9+
*.p8
10+
gmail_credentials.json
11+
gmail_token.json

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ __pycache__/
22
.cache/
33
venv/
44

5+
.env
56
.envrc
67
*.pyc
78
*.db

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.7
1+
FROM python:3.8
22

33
RUN mkdir /usr/src/app
44
WORKDIR /usr/src/app

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: "3.8"
2+
services:
3+
coursegrab:
4+
build: .
5+
env_file: ".env"
6+
ports:
7+
- "5000:5000"

requirements.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ appdirs==1.4.3
33
aspy.yaml==1.3.0
44
attrs==19.3.0
55
beautifulsoup4==4.8.1
6-
black
6+
black==20.8b1
77
CacheControl==0.12.6
88
cachetools==4.0.0
99
certifi==2019.9.11
1010
cffi==1.14.0
1111
cfgv==2.0.1
1212
chardet==3.0.4
13-
Click==7.0
13+
Click==7.1.2
1414
cryptography==2.9
1515
entrypoints==0.3
1616
firebase-admin==4.0.1
@@ -20,11 +20,6 @@ Flask-Cors==3.0.1
2020
Flask-Migrate==2.5.2
2121
Flask-Script==2.0.6
2222
Flask-SQLAlchemy==2.4.1
23-
google-api-core==1.26.2
24-
google-api-python-client==2.0.2
25-
google-auth==1.28.0
26-
google-auth-httplib2==0.1.0
27-
google-auth-oauthlib==0.4.3
2823
google-cloud-core==1.3.0
2924
google-cloud-firestore==1.6.2
3025
google-cloud-storage==1.27.0
@@ -77,12 +72,12 @@ sendgrid==6.1.2
7772
six==1.13.0
7873
soupsieve==1.9.5
7974
SQLAlchemy==1.3.11
80-
toml==0.10.0
75+
toml==0.10.1
8176
typed-ast==1.4.1
8277
typing-extensions==3.7.4.3
8378
uritemplate==3.0.1
8479
urllib3==1.25.6
8580
virtualenv==16.7.7
8681
wcwidth==0.1.8
8782
Werkzeug==0.16.0
88-
zipp==0.6.0
83+
zipp==0.6.0

requirements.txt.bak

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
alembic==1.4.1
2+
appdirs==1.4.3
3+
aspy.yaml==1.3.0
4+
attrs==19.3.0
5+
beautifulsoup4==4.8.1
6+
black
7+
CacheControl==0.12.6
8+
cachetools==4.0.0
9+
certifi==2019.9.11
10+
cffi==1.14.0
11+
cfgv==2.0.1
12+
chardet==3.0.4
13+
Click==7.0
14+
cryptography==2.9
15+
entrypoints==0.3
16+
firebase-admin==4.0.1
17+
flake8==3.7.9
18+
Flask==1.1.1
19+
Flask-Cors==3.0.1
20+
Flask-Migrate==2.5.2
21+
Flask-Script==2.0.6
22+
Flask-SQLAlchemy==2.4.1
23+
google-api-core==1.26.2
24+
google-api-python-client==2.0.2
25+
google-auth==1.28.0
26+
google-auth-httplib2==0.1.0
27+
google-auth-oauthlib==0.4.3
28+
google-cloud-core==1.3.0
29+
google-cloud-firestore==1.6.2
30+
google-cloud-storage==1.27.0
31+
google-resumable-media==0.5.0
32+
googleapis-common-protos==1.51.0
33+
grpcio==1.28.1
34+
h2==2.6.2
35+
hpack==3.0.0
36+
httplib2==0.18.0
37+
hyper==0.7.0
38+
hyperframe==3.2.0
39+
identify==1.4.7
40+
idna==2.8
41+
importlib-metadata==0.23
42+
importlib-resources==1.0.2
43+
itsdangerous==1.1.0
44+
Jinja2==2.10.3
45+
Mako==1.1.2
46+
MarkupSafe==1.1.1
47+
mccabe==0.6.1
48+
more-itertools==7.2.0
49+
msgpack==1.0.0
50+
mypy-extensions==0.4.3
51+
nodeenv==1.3.3
52+
oauthlib==3.1.0
53+
packaging==20.1
54+
pathspec==0.7.0
55+
pluggy==0.13.1
56+
pre-commit==1.20.0
57+
protobuf==3.15.6
58+
py==1.8.1
59+
pyasn1==0.4.8
60+
pyasn1-modules==0.2.8
61+
pycodestyle==2.5.0
62+
pycparser==2.20
63+
pyflakes==2.1.1
64+
PyJWT==1.7.1
65+
pyparsing==2.4.6
66+
pytest==5.3.5
67+
python-dateutil==2.8.1
68+
python-editor==1.0.4
69+
python-http-client==3.2.5
70+
pytz==2019.3
71+
PyYAML==5.1.2
72+
regex==2020.1.8
73+
requests==2.22.0
74+
requests-oauthlib==1.3.0
75+
rsa==4.0
76+
sendgrid==6.1.2
77+
six==1.13.0
78+
soupsieve==1.9.5
79+
SQLAlchemy==1.3.11
80+
toml==0.10.0
81+
typed-ast==1.4.1
82+
typing-extensions==3.7.4.3
83+
uritemplate==3.0.1
84+
urllib3==1.25.6
85+
virtualenv==16.7.7
86+
wcwidth==0.1.8
87+
Werkzeug==0.16.0
88+
zipp==0.6.0

src/app/coursegrab/dao/courses_dao.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
def get_course_by_id(course_id):
66
return Course.query.filter_by(id=course_id).first()
77

8+
89
def get_course_by_subject_and_course_num(subject_code, course_num):
910
return Course.query.filter_by(subject_code=subject_code, course_num=course_num).first()
1011

@@ -26,11 +27,13 @@ def search_courses(query):
2627
results = sorted(results, key = lambda r : find_query_index(r, query))
2728
return results
2829

30+
2931
def find_query_index(course, key):
3032
try:
3133
return course.search_string.lower().index(key.lower())
3234
except(ValueError):
3335
return -1
3436

37+
3538
def clear_table():
3639
Course.query.delete()

0 commit comments

Comments
 (0)