Skip to content

HDXDSYS-3021 Upgrade ruff, pre-commit hooks and GitHub Actions; fix new lint violations - #128

Merged
mcarans merged 1 commit into
mainfrom
upgrade-ruff-actions
Oct 28, 2026
Merged

mcarans merged 1 commit into
mainfrom
upgrade-ruff-actions

Conversation

@mcarans

@mcarans mcarans commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Version bumps

Item Old New
actions/checkout v6.1.0 v7.0.1
astral-sh/setup-uv v7.6.0 v10.3.2
ruff (pre-commit and dev dependency) 0.14.14 0.17.3
uv-pre-commit 0.9.25 0.13.6
hdx-python-utilities minimum 4.2.5 4.2.6

uv.lock upgraded. The setup-uv v10 and checkout v7 breaking changes only affect pull_request_target, workflow_run and release caching/fork checkout, which these workflows don't rely on.

Lint fixes

Ruff 0.17 expanded its default rule set, which raised 102 violations. tool.ruff is unchanged; the code was fixed instead:

  • Collapsed nested if/with, merged isinstance calls, explicit X | None for None defaults, None instead of mutable default arguments in Dataset.revise
  • ClassVar annotations on class-level dicts/lists
  • suppress(HDXError) instead of except Exception: pass in Location/Organization (_write_to_hdx wraps all errors in HDXError)
  • Removed executable bits from 36 .py files without shebangs
  • Missing end-of-file newlines in docs

Bug fix

today: datetime = now_utc() in DateHelper.get_time_period_info, Dataset.get_time_period and Resource.get_date_of_resource was evaluated once at import, so long-running processes used a stale date. These now default to None and call now_utc() at call time.

…violations

- actions/checkout v7.0.1, astral-sh/setup-uv v10.3.2
- ruff 0.17.3, uv-pre-commit 0.13.6
- hdx-python-utilities >= 4.2.6
- Fix violations from ruff 0.17's expanded default rules
- Default today to None instead of now_utc() evaluated at import
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Test Results

194 tests  ±0   194 ✅ ±0   1m 37s ⏱️ +6s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3cb86c8. ± Comparison against base commit 074ada5.

♻️ This comment has been updated with latest results.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.4% (+0.08%) from 97.318% — upgrade-ruff-actions into main

@mcarans
mcarans merged commit e8b2af7 into main Oct 28, 2026
5 of 6 checks passed
@mcarans mcarans changed the title Upgrade ruff, pre-commit hooks and GitHub Actions; fix new lint violations HDXDSYS-3021 Upgrade ruff, pre-commit hooks and GitHub Actions; fix new lint violations Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants