modernize and standardize: uv, Python 3.14, pathlib, pytest, pre-commit, canonical CI#8
modernize and standardize: uv, Python 3.14, pathlib, pytest, pre-commit, canonical CI#8
Conversation
|
@keboola-pr-reviewer review |
1 similar comment
|
@keboola-pr-reviewer review |
There was a problem hiding this comment.
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
matyas-jirat-keboola
left a comment
There was a problem hiding this comment.
Hmm škoda že to neschválil botík... To by chtělo poladit
Too bad the bot didn't even finish the sentence… 😏 😁 |
Summary
Brings
component-onedriveup 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)
apply ruff formatting baselineruff formatandruff check --fix(withextend-select=I,UPandline-length=120) once across the codebase. Establishes a clean baseline so subsequent commits show only their real intent.migrate to uv with Python 3.14 📦requirements.txtwith uv +pyproject.tomlon Python 3.14. Multi-stageDockerfile(leanbase/production,testadds dev deps + runsruff check+pytest). Drop legacy/Windows/flake8 cruft (flake8.cfg,deploy.sh,docs/imgs/, Windows.ps1/.batscripts,tests/__init__.py). Populate empty URL stub files. Nobuild-essential— all deps are pure Python or ship wheels forpython:3.14-slim.convert os.path to pathlibos.path.join→Path() /,os.path.exists→.exists(),os.path.basename→.name.os.sepusage in_split_path_maskdeliberately untouched (would risk behaviour drift in cross-platform splitting logic).migrate unittest to pytestunittest.TestCaseandunittest.main()in favour of plain pytest functions. Keepfrom unittest import mock(still the standard library mock).add pre-commit hooks.pre-commit-config.yamlwith ruff-format-check, ruff-check, ty-check, pytest as local hooks. ty is advisory here (; trueso it never blocks) — appropriate for an existing component. Verified end-to-end withpre-commit run --all-files.adopt canonical CI workflowpush.ymlwith a 17-line call to the reusablekeboola/component-ci/.github/workflows/component-pipeline.yml@master.Testing
docker build --target test+docker run→ pytest passes locallypre-commit run --all-files→ ruff-format-check, ruff-check, pytest all green; ty-check shows 4 advisory diagnostics (non-blocking, follow-up)