From 7adae645daade5856dabd6267b98064bc99dbb57 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Tue, 29 Nov 2022 09:27:47 +0000 Subject: [PATCH 01/21] Adding initial gitpod setup --- .gitpod.dockerfile | 6 ++++++ .gitpod.yml | 31 +++++++++++++++++++++++++++++++ .python-version | 1 + 3 files changed, 38 insertions(+) create mode 100644 .gitpod.dockerfile create mode 100644 .gitpod.yml create mode 100644 .python-version diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile new file mode 100644 index 0000000..b984831 --- /dev/null +++ b/.gitpod.dockerfile @@ -0,0 +1,6 @@ +FROM gitpod/workspace-postgresql + +RUN sudo apt-get update \ + && sudo apt-get install -y \ + tool \ + && sudo rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..53b0c21 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,31 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) +# and commit this file to your remote git repository to share the goodness with others. + +image: + file: .gitpod.dockerfile + +tasks: + - init: | + brew install redis + nvm install 0.12.7 + nvm use 0.12.7 + npm install -g yuglify + brew install forego + pip install virtualenv + virtualenv venv --python=python2.7 + createdb layuplist + source ./scripts/dev/environment.sh + source ./scripts/dev/virtualize.sh + pip2.7 install -r requirements.txt + python manage.py migrate + command: | + source ./scripts/dev/environment.sh + source ./scripts/dev/virtualize.sh + redis-server + pg_start + python manage.py collectstatic + forego start + + + diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..35b46ae --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +2.7.16 From c14fcf9ad0b7078171c745295a2bcd5b61ffb32b Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Tue, 29 Nov 2022 09:34:29 +0000 Subject: [PATCH 02/21] remove installation of unspecified "tool" from dockerfile --- .gitpod.dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile index b984831..5d43205 100644 --- a/.gitpod.dockerfile +++ b/.gitpod.dockerfile @@ -1,6 +1,4 @@ FROM gitpod/workspace-postgresql RUN sudo apt-get update \ - && sudo apt-get install -y \ - tool \ && sudo rm -rf /var/lib/apt/lists/* \ No newline at end of file From a8f068e91ea2afa4ffe00bc50ad57e08b20c3cb3 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Tue, 29 Nov 2022 09:54:37 +0000 Subject: [PATCH 03/21] Adding installation of python 2.7.16 to gitpod.yml --- .gitpod.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 53b0c21..9a113b9 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -12,7 +12,8 @@ tasks: nvm use 0.12.7 npm install -g yuglify brew install forego - pip install virtualenv + pyenv install 2.7.16 + pip2.7 install virtualenv virtualenv venv --python=python2.7 createdb layuplist source ./scripts/dev/environment.sh From 2fb1524abf275e8e5b7f1be309d3176a5d2ab57a Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 2 Dec 2022 07:21:36 +0000 Subject: [PATCH 04/21] Adding to gitpod config --- .gitpod.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 9a113b9..ad9e5c0 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,12 +1,11 @@ -# This configuration file was automatically generated by Gitpod. -# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) -# and commit this file to your remote git repository to share the goodness with others. image: file: .gitpod.dockerfile tasks: - init: | + brew tap heroku/brew + brew install heroku brew install redis nvm install 0.12.7 nvm use 0.12.7 @@ -29,4 +28,13 @@ tasks: forego start +ports: + - port: 3000 + onOpen: open-preview + name: Website + description: Website Preview + +vscode: + extensions: + - ms-python.python \ No newline at end of file From 132a5db65fd083140cebbb137dbab955e3f0b969 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 2 Dec 2022 07:27:17 +0000 Subject: [PATCH 05/21] changes to fix for current term --- CONTRIBUTING.md | 2 +- apps/spider/tasks.py | 2 ++ apps/web/views.py | 10 +++++----- scripts/dev/virtualize.sh | 2 ++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00ac8a0..3103742 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ Local Setup (macOS or OS X) REDIS_URL=redis://[YOUR_USERNAME]@localhost:6379 SECRET_KEY=[SOME_LONG_RANDOM_STRING] DEBUG=True - CURRENT_TERM=20X + CURRENT_TERM=22W OFFERINGS_THRESHOLD_FOR_TERM_UPDATE=100 ``` diff --git a/apps/spider/tasks.py b/apps/spider/tasks.py index f5b0cdf..9f7d7b9 100644 --- a/apps/spider/tasks.py +++ b/apps/spider/tasks.py @@ -31,6 +31,8 @@ def import_pending_crawled_data(crawled_data_pk): @task_utils.email_if_fails def crawl_medians(): median_page_urls = medians.crawl_median_page_urls() + if CURRENT_TERM == "22W": + assert len(median_page_urls) == 8 # special case for 22W, which only has 8 medians assert len(median_page_urls) == 10 # the registrar medians web page always keeps a list links to the past ten academic terms for url in median_page_urls: crawl_term_median_page.delay(url) diff --git a/apps/web/views.py b/apps/web/views.py index e211f93..06c30e8 100644 --- a/apps/web/views.py +++ b/apps/web/views.py @@ -38,12 +38,12 @@ from lib import constants import uuid -from google.cloud import pubsub_v1 +# from google.cloud import pubsub_v1 -pub_sub_publisher = pubsub_v1.PublisherClient() -topic_paths = { - 'course-views': pub_sub_publisher.topic_path(os.environ['GCLOUD_PROJECT_ID'], 'course-views') -} +# pub_sub_publisher = pubsub_v1.PublisherClient() +# topic_paths = { +# 'course-views': pub_sub_publisher.topic_path(os.environ['GCLOUD_PROJECT_ID'], 'course-views') +# } LIMITS = { 'courses': 20, diff --git a/scripts/dev/virtualize.sh b/scripts/dev/virtualize.sh index e9b511a..6c43181 100644 --- a/scripts/dev/virtualize.sh +++ b/scripts/dev/virtualize.sh @@ -1,3 +1,5 @@ . ~/.zshrc export PS1="(layup-list) $PS1" +# source ../venv/bin/activate +source venv/bin/activate source venv/bin/activate From fa9f9f6df954a1cd3f6bbc1c7787a0f6db64f365 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Sun, 11 Dec 2022 17:58:52 -0800 Subject: [PATCH 06/21] Comment out the "command" part of gitpod startup --- .gitpod.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index ad9e5c0..62df22b 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,3 +1,4 @@ +# the gitpod-provided dockerfile provides the deafult gitpod environment with the addition of Postgres image: file: .gitpod.dockerfile @@ -19,13 +20,13 @@ tasks: source ./scripts/dev/virtualize.sh pip2.7 install -r requirements.txt python manage.py migrate - command: | - source ./scripts/dev/environment.sh - source ./scripts/dev/virtualize.sh - redis-server - pg_start - python manage.py collectstatic - forego start + # command: | + # source ./scripts/dev/environment.sh + # source ./scripts/dev/virtualize.sh + # redis-server + # pg_start + # python manage.py collectstatic + # forego start ports: From 3d240708cf060ad21c22514099083ab1bbdae36b Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 02:23:12 +0000 Subject: [PATCH 07/21] remove more parts from gitpod.yml because .env file is hard to create automatically --- .gitpod.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 62df22b..dd07ad6 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -16,10 +16,10 @@ tasks: pip2.7 install virtualenv virtualenv venv --python=python2.7 createdb layuplist - source ./scripts/dev/environment.sh - source ./scripts/dev/virtualize.sh - pip2.7 install -r requirements.txt - python manage.py migrate + # source ./scripts/dev/environment.sh + # source ./scripts/dev/virtualize.sh + # pip2.7 install -r requirements.txt + # python manage.py migrate # command: | # source ./scripts/dev/environment.sh # source ./scripts/dev/virtualize.sh From 075a5e60b4529f19dc0a4c8ce27cb182e900c155 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 06:48:50 +0000 Subject: [PATCH 08/21] Name terminal for dev env setup --- .gitpod.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index dd07ad6..71b7740 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,7 +4,8 @@ image: file: .gitpod.dockerfile tasks: - - init: | + - name: LL terminal + init: | brew tap heroku/brew brew install heroku brew install redis From 37cd41ef6f54a2eb35aec12133284ba89cc3b285 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 07:40:02 +0000 Subject: [PATCH 09/21] removing commented parts of gitpod.yml --- .gitpod.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 71b7740..f8bfb5b 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -10,31 +10,26 @@ tasks: brew install heroku brew install redis nvm install 0.12.7 - nvm use 0.12.7 npm install -g yuglify brew install forego pyenv install 2.7.16 pip2.7 install virtualenv virtualenv venv --python=python2.7 createdb layuplist - # source ./scripts/dev/environment.sh - # source ./scripts/dev/virtualize.sh - # pip2.7 install -r requirements.txt - # python manage.py migrate - # command: | - # source ./scripts/dev/environment.sh - # source ./scripts/dev/virtualize.sh - # redis-server - # pg_start - # python manage.py collectstatic - # forego start + command: | + nvm use 0.12.7 ports: - port: 3000 onOpen: open-preview - name: Website + name: website description: Website Preview + - port: 5432 + onOpen: ignore + name: db + description: Postgres Database + vscode: From 7ada834dab89166c87232b65ea40f04f8c7b2cd3 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 08:24:51 +0000 Subject: [PATCH 10/21] Changes to gitpod.yml to remove double start of postgres --- .gitpod.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index f8bfb5b..280f6c1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,23 +1,17 @@ # the gitpod-provided dockerfile provides the deafult gitpod environment with the addition of Postgres - -image: - file: .gitpod.dockerfile - tasks: - name: LL terminal init: | brew tap heroku/brew brew install heroku + brew install postgres brew install redis - nvm install 0.12.7 npm install -g yuglify brew install forego pyenv install 2.7.16 pip2.7 install virtualenv virtualenv venv --python=python2.7 createdb layuplist - command: | - nvm use 0.12.7 ports: @@ -34,4 +28,5 @@ ports: vscode: extensions: - - ms-python.python \ No newline at end of file + - ms-python.python + - eamodio.gitlens \ No newline at end of file From 924b3299c918b120fa6e53edfd0eccc2b4973635 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 08:25:34 +0000 Subject: [PATCH 11/21] Adding popsql ip addresses to allowed hosts for postgres --- layup_list/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layup_list/settings.py b/layup_list/settings.py index 2bf7264..5aae4c9 100644 --- a/layup_list/settings.py +++ b/layup_list/settings.py @@ -6,7 +6,7 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) SECRET_KEY = os.environ['SECRET_KEY'] DEBUG = os.environ['DEBUG'] == "True" -ALLOWED_HOSTS = ['ll-prod.herokuapp.com', '.layuplist.com'] if not DEBUG else ['0.0.0.0', 'localhost'] +ALLOWED_HOSTS = ['ll-prod.herokuapp.com', '.layuplist.com'] if not DEBUG else ['0.0.0.0', 'localhost', '23.20.131.72', '54.211.234.135'] AUTO_IMPORT_CRAWLED_DATA = os.environ.get('AUTO_IMPORT_CRAWLED_DATA') == "True" INSTALLED_APPS = [ From 6adde18101abfff88d150d2e19d8e3b984a1aaae Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 09:22:27 +0000 Subject: [PATCH 12/21] update to try to get postgres working with gitpod --- .gitpod.dockerfile | 1 + .gitpod.yml | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile index 5d43205..f4a7cf4 100644 --- a/.gitpod.dockerfile +++ b/.gitpod.dockerfile @@ -1,4 +1,5 @@ FROM gitpod/workspace-postgresql +RUN sudo install-packages postgresql-12 postgresql-contrib-12 RUN sudo apt-get update \ && sudo rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml index 280f6c1..6e30a05 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,10 +1,12 @@ # the gitpod-provided dockerfile provides the deafult gitpod environment with the addition of Postgres +image: + file: .gitpod.dockerfile + tasks: - name: LL terminal init: | brew tap heroku/brew brew install heroku - brew install postgres brew install redis npm install -g yuglify brew install forego @@ -19,10 +21,6 @@ ports: onOpen: open-preview name: website description: Website Preview - - port: 5432 - onOpen: ignore - name: db - description: Postgres Database From c4536cb08b39745e5ccab3c12245bf19896fa27c Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 10:54:54 +0000 Subject: [PATCH 13/21] Moving commands to before section in gitpod.yml --- .gitpod.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 6e30a05..ae06d23 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -4,20 +4,22 @@ image: tasks: - name: LL terminal - init: | - brew tap heroku/brew - brew install heroku + before: | + brew tap heroku/brew && brew install heroku brew install redis npm install -g yuglify brew install forego pyenv install 2.7.16 pip2.7 install virtualenv - virtualenv venv --python=python2.7 createdb layuplist + init: | + virtualenv venv --python=python2.7 + command: | + ports: - - port: 3000 + - port: 5000 onOpen: open-preview name: website description: Website Preview From b0b312353f1081ccadf057025ec27619427013eb Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Mon, 12 Dec 2022 10:55:06 +0000 Subject: [PATCH 14/21] Adding * to allowed hosts in debug mode --- layup_list/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layup_list/settings.py b/layup_list/settings.py index 5aae4c9..fb7ab7c 100644 --- a/layup_list/settings.py +++ b/layup_list/settings.py @@ -6,7 +6,7 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) SECRET_KEY = os.environ['SECRET_KEY'] DEBUG = os.environ['DEBUG'] == "True" -ALLOWED_HOSTS = ['ll-prod.herokuapp.com', '.layuplist.com'] if not DEBUG else ['0.0.0.0', 'localhost', '23.20.131.72', '54.211.234.135'] +ALLOWED_HOSTS = ['ll-prod.herokuapp.com', '.layuplist.com'] if not DEBUG else ['0.0.0.0', 'localhost', '23.20.131.72', '54.211.234.135', '*'] AUTO_IMPORT_CRAWLED_DATA = os.environ.get('AUTO_IMPORT_CRAWLED_DATA') == "True" INSTALLED_APPS = [ From 8e30f1555ea0efcca0d38926365874509e8c597e Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Thu, 15 Dec 2022 23:50:58 -0800 Subject: [PATCH 15/21] moving commands to init and turning off prebuilds --- .gitpod.yml | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index ae06d23..4404481 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,18 +3,30 @@ image: file: .gitpod.dockerfile tasks: + - name: Redis + command: redis-server - name: LL terminal before: | - brew tap heroku/brew && brew install heroku - brew install redis - npm install -g yuglify - brew install forego + gp env > .env pyenv install 2.7.16 - pip2.7 install virtualenv + npm install -g yuglify createdb layuplist init: | + brew tap heroku/brew && brew install heroku + brew install redis + brew install forego + pip install virtualenv virtualenv venv --python=python2.7 + source ./scripts/dev/environment.sh + source ./scripts/dev/virtualize.sh + pip install -r requirements.txt + python manage.py migrate command: | + source ./scripts/dev/environment.sh + source ./scripts/dev/virtualize.sh + python manage.py collectstatic + forego start + @@ -29,4 +41,21 @@ ports: vscode: extensions: - ms-python.python - - eamodio.gitlens \ No newline at end of file + - eamodio.gitlens + +github: + prebuilds: + # enable for the default branch (defaults to true) + master: false + # enable for all branches in this repo (defaults to false) + branches: false + # enable for pull requests coming from this repo (defaults to true) + pullRequests: false + # enable for pull requests coming from forks (defaults to false) + pullRequestsFromForks: false + # add a check to pull requests (defaults to true) + addCheck: false + # add a "Review in Gitpod" button as a comment to pull requests (defaults to false) + addComment: false + # add a "Review in Gitpod" button to the pull request's description (defaults to false) + addBadge: false \ No newline at end of file From 814948601dd8941c3b677af8b15f7798b0d7ba36 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 16 Dec 2022 00:32:01 -0800 Subject: [PATCH 16/21] removing redundant call to venv activate --- scripts/dev/virtualize.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/dev/virtualize.sh b/scripts/dev/virtualize.sh index 6c43181..e9b511a 100644 --- a/scripts/dev/virtualize.sh +++ b/scripts/dev/virtualize.sh @@ -1,5 +1,3 @@ . ~/.zshrc export PS1="(layup-list) $PS1" -# source ../venv/bin/activate -source venv/bin/activate source venv/bin/activate From a8d6a0de1b710344b5f0cfbf90fb411f2d69f1b6 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 16 Dec 2022 01:27:02 -0800 Subject: [PATCH 17/21] Remove call to environment.sh The call to environment.sh seems to not be doing anything besides running `heroku local: run zsh`, the main benefit of which is that it exports the environment variables from .env, which we can do with gitpod in this case. Removing the call eliminates an issue with the init task of the gitpod.yml --- .gitpod.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 4404481..15713df 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -3,11 +3,10 @@ image: file: .gitpod.dockerfile tasks: - - name: Redis - command: redis-server - name: LL terminal before: | gp env > .env + eval $(gp env -e) pyenv install 2.7.16 npm install -g yuglify createdb layuplist @@ -17,14 +16,13 @@ tasks: brew install forego pip install virtualenv virtualenv venv --python=python2.7 - source ./scripts/dev/environment.sh source ./scripts/dev/virtualize.sh pip install -r requirements.txt python manage.py migrate command: | - source ./scripts/dev/environment.sh source ./scripts/dev/virtualize.sh python manage.py collectstatic + redis-server & forego start From f1c5b0980a8610c6b95bf00dee193caec77bef80 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 16 Dec 2022 09:51:53 +0000 Subject: [PATCH 18/21] Moving more gitpod.yml commands to before task --- .gitpod.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 15713df..b8bdae5 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -7,15 +7,15 @@ tasks: before: | gp env > .env eval $(gp env -e) - pyenv install 2.7.16 - npm install -g yuglify - createdb layuplist - init: | brew tap heroku/brew && brew install heroku brew install redis brew install forego + pyenv install 2.7.16 + npm install -g yuglify + init: | pip install virtualenv virtualenv venv --python=python2.7 + createdb layuplist source ./scripts/dev/virtualize.sh pip install -r requirements.txt python manage.py migrate From 5dc3959a562ed75d8e6216a22cc1c9a800ee4811 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 16 Dec 2022 02:09:28 -0800 Subject: [PATCH 19/21] Moving installation of python 2.7.16 to init task Long-running commands like installing a python version are better in the init task if they only need to be run once per workspace. --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index b8bdae5..0a1fee7 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -10,9 +10,9 @@ tasks: brew tap heroku/brew && brew install heroku brew install redis brew install forego - pyenv install 2.7.16 npm install -g yuglify init: | + pyenv install 2.7.16 pip install virtualenv virtualenv venv --python=python2.7 createdb layuplist From 04ca1ab7a3006165eb9bc8021d78f95afac95952 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 16 Dec 2022 02:44:38 -0800 Subject: [PATCH 20/21] Add Gitpod info to Contributing.md --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3103742..75ed696 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,16 @@ To contribute code, make a pull request. Github has a great support@layuplist.com if you need any help. +Pre-configured Development Environment (Gitpod) +----------------- +Layup List has a number of old dependencies and technologies and uses python 2.7.16, [which is deprecated](https://github.com/layuplist/layup-list/issues/62) as its main language. These factors can make setting up a local development for Layup List a little precarious and often frustrating. + +Therefore, we have set up a pre-configured development environment for new Layup List contributors using [Gitpod](https://www.gitpod.io/). Developers can make a free Gitpod account and get 50 hours of development time per month for no cost. Even better, students can receive a free upgrade to a Gitpod "personal" plan with the [Github student developer pack](https://education.github.com/pack) to get another 50 hours free. + +**To set up your Gitpod account to work with Layup List, see [this Wiki](https://github.com/zack-overflow/layup-list/wiki/Developing-for-Layup-List-with-Gitpod)!** + +If you prefer to set up your own local development environment, follow the instructions below. + Local Setup (macOS or OS X) ----------------- #### Installation From 62dd150933bfd2b6ae9b25399b549d2226b21c26 Mon Sep 17 00:00:00 2001 From: Zack Gottesman Date: Fri, 16 Dec 2022 02:57:30 -0800 Subject: [PATCH 21/21] Reverting some change unrelated to Gitpod --- CONTRIBUTING.md | 2 +- apps/spider/tasks.py | 2 -- apps/web/views.py | 10 +++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 75ed696..074bc03 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ Local Setup (macOS or OS X) REDIS_URL=redis://[YOUR_USERNAME]@localhost:6379 SECRET_KEY=[SOME_LONG_RANDOM_STRING] DEBUG=True - CURRENT_TERM=22W + CURRENT_TERM=20X OFFERINGS_THRESHOLD_FOR_TERM_UPDATE=100 ``` diff --git a/apps/spider/tasks.py b/apps/spider/tasks.py index 9f7d7b9..f5b0cdf 100644 --- a/apps/spider/tasks.py +++ b/apps/spider/tasks.py @@ -31,8 +31,6 @@ def import_pending_crawled_data(crawled_data_pk): @task_utils.email_if_fails def crawl_medians(): median_page_urls = medians.crawl_median_page_urls() - if CURRENT_TERM == "22W": - assert len(median_page_urls) == 8 # special case for 22W, which only has 8 medians assert len(median_page_urls) == 10 # the registrar medians web page always keeps a list links to the past ten academic terms for url in median_page_urls: crawl_term_median_page.delay(url) diff --git a/apps/web/views.py b/apps/web/views.py index 06c30e8..e211f93 100644 --- a/apps/web/views.py +++ b/apps/web/views.py @@ -38,12 +38,12 @@ from lib import constants import uuid -# from google.cloud import pubsub_v1 +from google.cloud import pubsub_v1 -# pub_sub_publisher = pubsub_v1.PublisherClient() -# topic_paths = { -# 'course-views': pub_sub_publisher.topic_path(os.environ['GCLOUD_PROJECT_ID'], 'course-views') -# } +pub_sub_publisher = pubsub_v1.PublisherClient() +topic_paths = { + 'course-views': pub_sub_publisher.topic_path(os.environ['GCLOUD_PROJECT_ID'], 'course-views') +} LIMITS = { 'courses': 20,