Skip to content
Open
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
43 changes: 21 additions & 22 deletions .github/workflows/cli-ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@ name: Integration Test for CLI workflow

on:
workflow_dispatch:
# pull_request:
# types:
# - opened
# - synchronize
# branches:
# - master
# paths-ignore:
# - "**.md"
# - "**.yaml"
# - "LICENSE"
# - "frontend/**"
# - ".github/workflows/frontend-ci-test.yaml"
# - ".github/workflows/deploy-gh-pages.yaml"
# - ".github/workflows/deploy-gyft-do.yaml"
# - "metaploy/**"
# - ".gitignore"
# - "app.py"
# - "wsgi.py"
# - ".dockerignore"
# - "Dofkerfile"
# - "Dofkerfile-dev"
pull_request:
types:
- opened
- synchronize
branches:
- master
paths-ignore:
- "**.md"
- "LICENSE"
- "frontend/**"
- ".github/workflows/frontend-ci-test.yaml"
- ".github/workflows/deploy-gh-pages.yaml"
- ".github/workflows/deploy-gyft-do.yaml"
- "metaploy/**"
- ".gitignore"
- "app.py"
- "wsgi.py"
- ".dockerignore"
- "Dofkerfile"
- "Dofkerfile-dev"

jobs:
cli-ci:
Expand Down Expand Up @@ -53,4 +52,4 @@ jobs:
echo "$CREDENTIALS_JSON" > credentials.json

- name: Run the project
run: python gyft.py -D
run: python gyft.py -DO
8 changes: 6 additions & 2 deletions utils/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def get_holidates() -> (list[datetime], list[str, datetime]):
scrapes holiday list from IITKGP website
returns: list of holidays as occasions and datetime objects
"""
headers = {
"timeout": "20",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36",
}
url = "https://www.iitkgp.ac.in/holidays"
result = requests.get(url).text
result = requests.get(url=url, headers=headers).text
doc = bs(result, "html.parser")
tbody = doc.tbody
trs = tbody.contents
Expand Down Expand Up @@ -182,4 +186,4 @@ def get_rfc_time(time: int, day: str, minute: int = 0, second: int = 0) -> str:

for hday in hdays.keys():
hdays[hday].sort()
hdays[hday] = list(set(hdays[hday])) ### datetime dict(list)
hdays[hday] = list(set(hdays[hday])) ### datetime dict(list)
Loading