Skip to content

modernize and standardize: uv, Python 3.14, pathlib, pytest, pre-commit, canonical CI#8

Open
soustruh wants to merge 6 commits intomainfrom
modernize-and-standardize
Open

modernize and standardize: uv, Python 3.14, pathlib, pytest, pre-commit, canonical CI#8
soustruh wants to merge 6 commits intomainfrom
modernize-and-standardize

Conversation

@soustruh
Copy link
Copy Markdown
Contributor

Summary

Brings component-onedrive up to current CF team standards. No runtime/behaviour changes — only tooling, build, and code-style modernization. Six focused commits, each independently reviewable.

Commits (in order)

# Commit What it does
1 apply ruff formatting baseline Run ruff format and ruff check --fix (with extend-select=I,UP and line-length=120) once across the codebase. Establishes a clean baseline so subsequent commits show only their real intent.
2 migrate to uv with Python 3.14 📦 Replace pip + requirements.txt with uv + pyproject.toml on Python 3.14. Multi-stage Dockerfile (lean base/production, test adds dev deps + runs ruff check + pytest). Drop legacy/Windows/flake8 cruft (flake8.cfg, deploy.sh, docs/imgs/, Windows .ps1/.bat scripts, tests/__init__.py). Populate empty URL stub files. No build-essential — all deps are pure Python or ship wheels for python:3.14-slim.
3 convert os.path to pathlib Mechanical: os.path.joinPath() /, os.path.exists.exists(), os.path.basename.name. os.sep usage in _split_path_mask deliberately untouched (would risk behaviour drift in cross-platform splitting logic).
4 migrate unittest to pytest Drop unittest.TestCase and unittest.main() in favour of plain pytest functions. Keep from unittest import mock (still the standard library mock).
5 add pre-commit hooks .pre-commit-config.yaml with ruff-format-check, ruff-check, ty-check, pytest as local hooks. ty is advisory here (; true so it never blocks) — appropriate for an existing component. Verified end-to-end with pre-commit run --all-files.
6 adopt canonical CI workflow Replace ~230 lines of handcrafted push.yml with a 17-line call to the reusable keboola/component-ci/.github/workflows/component-pipeline.yml@master.

Testing

  • docker build --target test + docker run → pytest passes locally
  • pre-commit run --all-files → ruff-format-check, ruff-check, pytest all green; ty-check shows 4 advisory diagnostics (non-blocking, follow-up)
  • Re-tested end-to-end in our testing project and at client's stack on the new image

@matyas-jirat-keboola
Copy link
Copy Markdown

@keboola-pr-reviewer review

1 similar comment
@matyas-jirat-keboola
Copy link
Copy Markdown

@keboola-pr-reviewer review

Copy link
Copy Markdown

@keboola-pr-reviewer keboola-pr-reviewer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: needs_human (risk 2/5) · profile component-factory

The vast majority of this PR is mechanical and safe: ruff formatting, uv/pyproject.toml migration, flake8/deploy.sh deletions, pathlib conversion, pytest migration, pre-commit setup, and canonical CI adoption all fall squarely within the "a…

Concerns:

  • src/client/client.py: _get_request_tokens() and Authorization header construction are credential-handling paths (OAuth token refresh) — policy requires human review regardless of change size.
  • src/component.py: _save_refresh_token_state / _save_to_state persist refresh tokens — same credential-handling escalation rule applies.

Suggested reviewers: @keboola/component-factory

Copy link
Copy Markdown

@matyas-jirat-keboola matyas-jirat-keboola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm škoda že to neschválil botík... To by chtělo poladit

@soustruh
Copy link
Copy Markdown
Contributor Author

The vast majority of this PR is mechanical and safe: ruff formatting, uv/pyproject.toml migration, flake8/deploy.sh deletions, pathlib conversion, pytest migration, pre-commit setup, and canonical CI adoption all fall squarely within the "a…

Hmm škoda že to neschválil botík... To by chtělo poladit

Too bad the bot didn't even finish the sentence… 😏 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants