AAP-59874: Update to Python 3.12 (#16208)

* update to Python 3.12

* remove use of utcnow

* switch to timezone.utc

datetime.UTC is an alias of datetime.timezone.utc. if we're doing the double import for datetime it's more straightforward to just import timezone as well and get it directly

* debug python env version issue

* change python version

* pin to SHA and remove debug portion
This commit is contained in:
jessicamack
2026-01-07 11:57:24 -05:00
committed by GitHub
parent 48c7534b57
commit de86b93690
29 changed files with 124 additions and 85 deletions

View File

@@ -129,14 +129,14 @@ the following dates are saved in the database:
- `main_schedule.rrule` - the original `RRULE` string provided by the user
- `main_schedule.dtstart` - the _first_ datetime in the list of all occurrences (coerced to UTC)
- `main_schedule.dtend` - the _last_ datetime in the list of all occurrences (coerced to UTC)
- `main_schedule.next_run` - the _next_ datetime in list after `utcnow()` (coerced to UTC)
- `main_schedule.next_run` - the _next_ datetime in list after `now(datetime.UTC)` (coerced to UTC)
AWX makes use of [Celery Periodic Tasks
(celerybeat)](http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html)
to run a periodic task that discovers new jobs that need to run at a regular
interval (by default, every 30 seconds). When this task starts, it queries the
database for Schedules where `Schedule.next_run` is between
`scheduler_last_runtime()` and `utcnow()`. For each of these, a new job is
`scheduler_last_runtime()` and `now(datetime.UTC)`. For each of these, a new job is
launched, and `Schedule.next_run` is changed to the next chronological datetime
in the list of all occurrences.