Skip to content

Replace setuptools with uv build backend and add Python 3.13 support#18

Merged
sykora-ji merged 9 commits intomainfrom
devin/1770666055-replace-pkg-resources-python313
Feb 18, 2026
Merged

Replace setuptools with uv build backend and add Python 3.13 support#18
sykora-ji merged 9 commits intomainfrom
devin/1770666055-replace-pkg-resources-python313

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Feb 9, 2026

Summary

Replace setuptools with uv_build as the build backend and pin snowflake-snowpark-python>=1.35.0 to fix the pkg_resources removal in setuptools 82.0.0.

Problem

setuptools 82.0.0 (released 2026-02-08) removed the pkg_resources module. This broke all DataApps using keboola_streamlit because snowflake-snowpark-python (older versions) internally imports pkg_resources at runtime. Customers hit ModuleNotFoundError: No module named 'pkg_resources' on app rebuild without any changes on their side.

Relates to: AJDA-2244 / SUPPORT-15269

Changes

Build backend migration (pyproject.toml):

  • Replaced setuptools with uv_build>=0.10.3,<0.11.0 as the build backend (zero-config, auto-discovers src/ layout)
  • Removed [tool.setuptools.*] sections (not needed with uv)
  • Aligns with keboola/python-component

Runtime fix (pyproject.toml):

  • Pinned snowflake-snowpark-python>=1.35.0 — this version no longer imports pkg_resources, which is the actual fix for the customer-facing error

Dependency locking (pyproject.toml, uv.lock, requirements.txt):

  • Removed requirements.txt — dependencies are now fully declared in pyproject.toml
  • Added [dependency-groups] with dev = ["pytest", "pre-commit"]
  • Generated uv.lock for reproducible installs
  • CI uses uv sync (single step) instead of separate pip install calls

CI pipeline (.github/workflows/publish.yml):

  • Switched to uv throughout: uv sync for deps, uv run for pre-commit/pytest, uv build for packaging, uv publish for PyPI
  • Replaced build + twine with native uv build / uv publish
  • Added astral-sh/setup-uv@v7 alongside actions/setup-python@v5
  • CI matrix for Python 3.10 and 3.13
  • Smoke test uses uv run --isolated --with dist/*.whl for clean validation

Python version support:

  • Dropped Python 3.9 (EOL), minimum is now >=3.10
  • Added Python 3.10–3.13 to supported classifiers and CI matrix

Test plan

  • CI passes on both Python 3.10 and 3.13
  • Smoke test builds wheel and successfully imports KeboolaStreamlit in isolated env
  • Publish job uses uv build + uv publish with existing PyPI credentials
  • After release: customer can upgrade keboola_streamlit and remove setuptools<82.0.0 workaround

Review & Testing Checklist for Human

  • Verify PyPI publish works with uv publish: The publish job now uses UV_PUBLISH_USERNAME / UV_PUBLISH_PASSWORD env vars (mapped from existing PYPI_USERNAME / PYPI_API_TOKEN secrets) instead of TWINE_USERNAME / TWINE_PASSWORD. This path only runs on tagged releases, so it has not been exercised by CI on this branch. Consider a dry-run build before the first tagged release.
  • Verify wheel contents: Run uv build --wheel && unzip -l dist/*.whl locally and confirm all expected source files from src/keboola_streamlit/ are present. The uv_build backend auto-discovers the src/ layout, replacing the explicit setuptools config.
  • Test real usage on Python 3.13: The smoke test only validates import. Verify actual Snowflake session creation and kbcstorage client calls work in a Python 3.13 environment.
  • Confirm requires-python >=3.10 is acceptable: Python 3.9 is EOL, but check if any existing users/deployments still rely on 3.8/3.9.

Suggested test plan: Install from this branch into clean Python 3.10 and 3.13 venvs (pip install git+https://github.com/keboola/keboola_streamlit@devin/1770666055-replace-pkg-resources-python313), then run from keboola_streamlit import KeboolaStreamlit and the existing pytest suite in both.

Notes

  • snowflake-snowpark-python 1.35.0+ supports Python 3.13 (requires-python: <3.14,>=3.9); versions ≤1.34.0 excluded it (<3.13).
  • The version = "v0.1.3" in pyproject.toml has a leading v which is not strictly PEP 440 compliant. This was pre-existing and not changed in this PR; uv_build appears to handle it, but worth noting.
  • Link to Devin run: https://app.devin.ai/sessions/79e2927a5d4948a092cfd2348fae4d1b
  • Requested by: Miro Čillík

Release Notes

Justification, description

Replace setuptools build backend with uv_build to support Python 3.13. Pin snowflake-snowpark-python>=1.35.0 for Python 3.13 compatibility. Migrate from requirements.txt to uv.lock for reproducible dependency resolution.

Plans for Customer Communication

N/A

Impact Analysis

Minimum Python version raised from 3.7 to 3.10. No functional code changes — only build tooling, dependency pins, and CI.

Deployment Plan

N/A

Rollback Plan

N/A

Post-Release Support Plan

N/A

… support

Co-Authored-By: Miro Čillík <miro@keboola.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Miro Čillík <miro@keboola.com>
@devin-ai-integration devin-ai-integration bot changed the title feat: replace setuptools/pkg_resources with hatchling for Python 3.13 support Replace setuptools with hatchling and add Python 3.13 support Feb 9, 2026
@MiroCillik MiroCillik requested a review from Copilot February 9, 2026 20:15
Co-Authored-By: Miro Čillík <miro@keboola.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project’s Python packaging and CI configuration to support Python 3.13 by switching the build backend from setuptools to hatchling, tightening dependency compatibility for Snowpark, and updating the publish workflow to run on Python 3.13.

Changes:

  • Switched build backend to hatchling and configured wheel packaging.
  • Bumped requires-python to >=3.9, added Python 3.9–3.13 classifiers, and pinned snowflake-snowpark-python>=1.35.0.
  • Updated GitHub Actions workflow to use newer action versions and Python 3.13, and adjusted publish dependencies accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Migrates build backend to hatchling, updates supported Python versions/classifiers, and pins Snowpark for 3.13 compatibility.
.github/workflows/publish.yml Updates CI/publish jobs to run on Python 3.13 and refreshes GitHub Action versions and build deps.
Comments suppressed due to low confidence (1)

pyproject.toml:7

  • version = "v0.1.3" is not PEP 440–compliant (the leading v is invalid in core metadata) and may cause hatchling/packaging to reject the build. Consider changing the project version to 0.1.3 (keep the v prefix only for git tags/releases).
build-backend = "hatchling.build"

[project]
name = "keboola_streamlit"
version = "v0.1.3"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml Outdated
Comment thread .github/workflows/publish.yml
Co-Authored-By: Miro Čillík <miro@keboola.com>
@MiroCillik MiroCillik marked this pull request as ready for review February 9, 2026 20:24
@MiroCillik MiroCillik requested a review from Copilot February 9, 2026 20:24
@MiroCillik MiroCillik requested a review from pandyandy February 9, 2026 20:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

.github/workflows/publish.yml:24

  • The workflow installs dependencies from requirements.txt, which still allows older snowflake-snowpark-python versions on Python 3.10 even though the package metadata now requires snowflake-snowpark-python>=1.35.0. To ensure CI matches what users get from PyPI, either pin the requirement in requirements.txt as well or install the project (e.g., pip install -e .) so dependencies are resolved from pyproject.toml.
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
          pip install pytest pre-commit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yml
Comment thread .github/workflows/publish.yml Outdated
Co-Authored-By: Miro Čillík <miro@keboola.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yml
@MiroCillik MiroCillik requested a review from soustruh February 11, 2026 09:16
devin-ai-integration bot and others added 3 commits February 11, 2026 09:19
Co-Authored-By: Miro Čillík <miro@keboola.com>
Switch from hatchling to uv_build as the build backend and migrate
the CI pipeline to use uv throughout (install, build, publish).
This aligns with keboola/python-component and provides significantly
faster dependency resolution and package building.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
setup-uv's python-version installs Python into a uv-managed directory
that is not recognized as a system Python. Use actions/setup-python
for the system Python and setup-uv only for the uv tool itself.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Feb 16, 2026

@sykora-ji sykora-ji requested review from sykora-ji and removed request for MiroCillik and sykora-ji February 17, 2026 08:01
soustruh
soustruh previously approved these changes Feb 18, 2026
Copy link
Copy Markdown
Collaborator

@soustruh soustruh left a comment

Choose a reason for hiding this comment

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

I'd really appreaciate a couple more changes, but as this ticket is close to (or already) breaching SLA, I approve this now 🙏

Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
- Add pytest and pre-commit as dev dependency group in pyproject.toml
- Generate uv.lock for proper dependency locking
- Remove requirements.txt (superseded by uv.lock)
- Use uv sync instead of pip install in CI
- Run pre-commit and pytest via uv run
- Simplify smoke test with uv run --isolated

Co-Authored-By: Miro Čillík <miro@keboola.com>
@devin-ai-integration devin-ai-integration bot changed the title Replace setuptools with hatchling and add Python 3.13 support Replace setuptools with uv build backend and add Python 3.13 support Feb 18, 2026
@sykora-ji sykora-ji requested a review from soustruh February 18, 2026 10:11
Copy link
Copy Markdown
Collaborator

@soustruh soustruh left a comment

Choose a reason for hiding this comment

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

Nice, everything looks OK now! 🎉

@sykora-ji sykora-ji merged commit 6be396a into main Feb 18, 2026
4 checks passed
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.

4 participants