Skip to content

Modernize tooling: uv build/test, just, ruff (drop Docker for Python envs & Make)#808

Merged
edavidaja merged 20 commits into
mainfrom
uv-tooling-modernization
Jul 1, 2026
Merged

Modernize tooling: uv build/test, just, ruff (drop Docker for Python envs & Make)#808
edavidaja merged 20 commits into
mainfrom
uv-tooling-modernization

Conversation

@edavidaja

@edavidaja edavidaja commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Modernizes the build and test toolchain onto an astral-native stack, removing Docker where it was only providing Python environments, and removing make. The Connect-server Docker setups (docker-compose.yml, vetiver-testing/, integration-testing/) are intentionally kept — uv cannot run the Connect product.

  • Build backend: setuptools + setuptools_scmuv_build (flat-layout module-name/module-root).
  • Versioning: git-tag-derived → static [project].version managed with uv version. main carries a .dev version (1.29.1.dev0) so dev installs stay pre-release (keeps the update-nag off) and never collide with a published release. Runtime VERSION now resolves via importlib.metadata (both published dist names). A CI guard asserts the tag matches the version on tag builds.
  • Dev tooling: moved to PEP 735 [dependency-groups] so ruff/pyright/twine/pytest/mkdocs are not advertised in the published wheel metadata. Genuine runtime features (keyring, snowflake, mcp) remain extras.
  • Lint/format: black + flake8ruff (format + check). pyright kept, advisory (matches today's behavior; see fix pyright errors #774).
  • Multi-version testing: per-version Docker images → uv run --python <X>.
  • Task runner: MakefileJustfile.
  • CI: main.yml + preview-docs.yml run on astral-sh/setup-uv + just; integration jobs keep the Docker Connect server but install/run via uv. Added a uv lock --locked drift check and a wheel-contents assertion (py.typed + quickstart templates present, tests excluded).

Deleted: Dockerfile, docs/Dockerfile, Makefile, setup.py, scripts/build-image, rsconnect/version.py.

Testing / review notes

  • just lint, just test <ver>, and just dist (wheel + sdist, twine check PASSED) verified locally; built wheel confirmed to contain rsconnect/py.typed and the quickstart templates and to exclude tests/.
  • Pre-existing, out-of-scope: 10 test failures present at the base commit (env-specific orjson/Cargo build for the shiny quickstart + test_main_content TEMP_DIR paths) and 131 pre-existing pyright strict errors (fix pyright errors #774, why pyright is advisory).
  • Fixed during review: the test-dev-connect job now passes --vetiver so vetiver tests actually run (the conftest skip-hook was previously inert and is now correctly applied).

Draft — open items before marking ready

  • Full CI run (multi-version matrix, integration jobs against live Connect) is green.
  • Confirm the uv_build>=0.9.0,<0.10.0 pin does not warn under the CI uv version.
edavidaja added 15 commits June 30, 2026 13:51
- Add tests/testdata to ruff extend-exclude (fixture notebooks, not source)
- Complete conftest.py pytest_collection_modifyitems (was missing the loop body)
- Reformat 7 source files with ruff format (black-compatible, line-length 120)
…docs

- Add --vetiver flag to dev-connect CI pytest call so vetiver tests
  actually run (without it conftest.py skips them unconditionally)
- Add wheel-contents assertion step in distributions job: verifies
  py.typed and quickstart templates present, no test files included
- Update CONTRIBUTING.md setup bullets to describe uv+just flow
- Update CLAUDE.md CI matrix range from 3.8-3.12 to 3.8-3.13
@edavidaja edavidaja force-pushed the uv-tooling-modernization branch from a4b5a83 to e66887d Compare June 30, 2026 17:57
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-01 19:23 UTC
The old Makefile injected CONNECT_CONTENT_BUILD_DIR=rsconnect-build-test via
TEST_ENV. The uv/just migration dropped it, so test_main_content.py asserted
against a build dir that was never used. Set it in conftest.py (imported before
any rsconnect import, since metadata.py binds the var as a default arg at import
time) so it works under both scripts/runtests and direct pytest invocations.
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7601 6305 83% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/init.py 67% 🟢
rsconnect/api.py 81% 🟢
rsconnect/environment_node.py 100% 🟢
rsconnect/log.py 72% 🟢
rsconnect/main.py 80% 🟢
rsconnect/subprocesses/inspect_environment.py 88% 🟢
TOTAL 81% 🟢

updated for commit: d8e63b6 by action🐍

uv cannot spawn the shebang ./scripts/runtests directly on Windows (os error
193: not a valid Win32 application). Invoke it through bash, which is available
on GitHub Windows runners, keeping scripts/runtests as the single source of
pytest args.
@edavidaja edavidaja marked this pull request as ready for review June 30, 2026 18:59
@edavidaja edavidaja requested a review from a team June 30, 2026 18:59
@nealrichardson

Copy link
Copy Markdown
Contributor

This is great. Can you also remove the .vscode settings file that insists on installing black?

Comment thread .vscode/extensions.json Outdated
@@ -1,6 +1,6 @@
{
"recommendations": [
"ms-python.vscode-pylance",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should drop pylance too

Comment thread Justfile Outdated
Co-authored-by: Kara Woo <karawoo@users.noreply.github.com>
@edavidaja edavidaja merged commit 13bcd1f into main Jul 1, 2026
23 checks passed
@edavidaja edavidaja deleted the uv-tooling-modernization branch July 1, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants