refactor: python-dateutil 换成标准库

- contest 后台创建/编辑:dateutil.parser.parse 换成
  datetime.fromisoformat。serializer 里 start_time/end_time 声明的是
  DateTimeField,而 validate_serializer 做的是 request.data = s.data,
  即重新序列化一遍,所以视图拿到的必定是 DRF 规范化后的 ISO 8601,
  dateutil 的宽容解析能力在这里从来没用上
- AI 学情统计:relativedelta 换成 shift_months 辅助函数,复刻月末
  收缩语义(1月31日 + 1个月 = 2月28/29日)。_parse_duration 的配置
  由 delta 对象改为 rewind/advance 可调用,周档和月档统一

删除依赖:python-dateutil、six

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-05 23:05:50 -06:00
parent 989b33d827
commit 8557f8a5f5
5 changed files with 30 additions and 50 deletions

View File

@@ -19,7 +19,6 @@ dependencies = [
"pillow>=12.2.0,<13",
"psycopg>=3.3.4,<4",
"psycopg-binary>=3.3.4,<4",
"python-dateutil>=2.9.0.post0,<3",
"sentry-sdk[django]>=2.0.0,<3",
"tree-sitter>=0.25.2",
"tree-sitter-c>=0.24.2",