internetarchive / internetarchive/openlibrary

Enable ruff rules DTZ for proper use of Python datetimes

Open
#13,412 1 comment 0 reactions 0 assignees View on GitHub
Affects: Developers Lead: @RayBB Needs: Breakdown Priority: 3
Dominant language
Python
Stars
6.7k
Forks
2k
Avg merge
2d 14h
Merged PRs (30d)
126

Description

Uncomment this line and then get pre-commit tests to pass:
https://github.com/internetarchive/openlibrary/blob/f60b655c32c1316414b597b31954a4751caa3de0/pyproject.toml#L120

The Python tests run by GitHub Actions report 12 warnings, most of which overlap with the DTZ rules on the proper use of Python datetimes. Fixing our compliance with the DTZ rules will reduce pytest warnings and allow us to focus on the remaining ones.

Contributor guide

Open the contributing guide

Research direction

Start at pyproject.toml line 120 and uncomment the DTZ rule configuration. Run the pre-commit checks and the Python tests from GitHub Actions to locate the 12 datetime-related warnings, then update the reported code locations. Done means pre-commit passes and the DTZ warnings are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing, tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.