feat: Add auto-fetch of semester dates from GMU registrar#1
Conversation
- Adds `calendar_parser.py` using `beautifulsoup4` and `python-dateutil` to fetch and parse start, end, and skip dates for a given semester from the GMU academic calendar. - Refactors `main.py` by extracting the booking loop into `execute_booking_run`. - Adds `book-semester <semester> <year>` command to dynamically construct the fetch URL, parse dates, and run the scheduling. - Updates dependencies and `README.md`. Co-authored-by: ahnafnafee <48362866+ahnafnafee@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Added `pytest` and `pytest-mock` to dependencies. - Added `tests/test_date_utils.py` for testing date calculation functions. - Added `tests/test_calendar_parser.py` with both unit and mocked playwright tests. - Added `tests/test_main.py` using `click.testing.CliRunner` to test CLI command workflows. - Added `tests/test_booker.py` as a confidence test using mocked Playwright objects. Co-authored-by: ahnafnafee <48362866+ahnafnafee@users.noreply.github.com>
- Created `.github/workflows/ci.yml` to run `uv run pytest`. - Configured triggers for `push` to `main` and `master`, and `pull_request` creation/updates. Co-authored-by: ahnafnafee <48362866+ahnafnafee@users.noreply.github.com>
Implemented dynamic web lookup of schedules for fall and spring semesters per year to better automate scheduling.
calendar_parser.py: A new module that usesplaywrightto render the GMU registrar page andbeautifulsoup4/python-dateutilto parse the academic calendar tables for the start date, end date, and any breaks (skip dates) for a given semester.book-semesterCommand: Updatedmain.pywith a new CLI commanduv run main.py book-semester <fall|spring|summer> <year>that leverages the parser, automatically updates the config, and executes the booking run.main.pyExecution: Extracted the core booking logic out ofbook_allintoexecute_booking_runso it can be reused.SEMESTER_START_DATEandSEMESTER_END_DATEare now properly validated withinbook_allinstead of globally on load.README.md.beautifulsoup4andpython-dateutiltopyproject.toml.PR created automatically by Jules for task 3601093727462650682 started by @ahnafnafee