Skip to content

CORE-1273: migrate from Poetry to uv - #2323

Open
haritamar wants to merge 5 commits into
masterfrom
core-1273-migrate-elementary-oss-from-poetry-to-uv
Open

CORE-1273: migrate from Poetry to uv#2323
haritamar wants to merge 5 commits into
masterfrom
core-1273-migrate-elementary-oss-from-poetry-to-uv

Conversation

@haritamar

@haritamar haritamar commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces Poetry with uv as the packaging/dev tool. pyproject.toml becomes standard PEP 621 metadata built by uv_build, and dev deps move from dev-requirements.txt into a uv dependency group. uv.lock is gitignored, matching the previous Poetry setup where poetry.lock was gitignored too, so resolution stays unpinned.

Because the package lives at the repo root rather than in src/, the build backend needs:

[build-system]
requires = ["uv_build>=0.9.0,<0.15.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-root = ""
module-name = "elementary"

Extras (snowflake, bigquery, ..., all) and the edr script are unchanged in behavior; the all extra is now expressed as a self-referential elementary-data[...] list, which is the PEP 621 equivalent of Poetry's extras aggregation.

On constraint-dependencies: urllib3, idna, pyasn1 and cryptography are transitive deps pinned only to dodge CVEs, so moving them to [tool.uv] constraint-dependencies is tempting — but constraints only affect this project's resolution and are not published in wheel metadata, so anyone pip install elementary-data would lose the floors. They stay in [project.dependencies].

CI/dev surface:

  • run-precommit: setup-python + pip → astral-sh/setup-uv + uv sync + uv run pre-commit.
  • test-warehouse / test-github-action: pip installuv pip install (with UV_SYSTEM_PYTHON=1), dev deps via uv pip install --group dev.
  • release: pip install build + python -m builduv build --sdist --wheel.
  • Dockerfile: uv 0.10.110.12.3 (it already installed via uv).

Verified locally: uv sync --all-extras, 451 unit tests pass, all pre-commit hooks pass, uv build artifacts contain the elementary package plus the bundled dbt project assets, wheel installs and edr --help works, and docker build + container run succeed.

Link to Devin session: https://app.devin.ai/sessions/c214461411ba46d9ab639b8ea12e69b5
Requested by: @haritamar

Summary by CodeRabbit

  • Chores

    • Migrated project and development dependency management to uv.
    • Updated build, test, pre-commit, and release workflows to use a consistent, pinned uv setup with caching.
    • Updated the container build environment to uv 0.12.3.
    • Consolidated development dependencies into project configuration and removed the separate development requirements file.
  • Documentation

    • Updated contributor setup and command instructions for the new uv-based workflow.

Convert pyproject.toml to PEP 621 with the uv_build backend, move dev-requirements.txt
into a dev dependency group, commit uv.lock, and switch CI and the Dockerfile to uv.

Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
@haritamar haritamar self-assigned this Aug 12, 2026
@linear

linear Bot commented Aug 12, 2026

Copy link
Copy Markdown

CORE-1273

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 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, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown
Contributor

👋 @haritamar
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3b7db666-8cfc-4970-a420-1b4927731141

📥 Commits

Reviewing files that changed from the base of the PR and between 39b8258 and 9327fff.

📒 Files selected for processing (4)
  • .github/workflows/run-precommit.yml
  • .gitignore
  • CONTRIBUTING.md
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (4)
  • .gitignore
  • .github/workflows/run-precommit.yml
  • CONTRIBUTING.md
  • pyproject.toml

📝 Walkthrough

Walkthrough

The project migrates from Poetry and pip to uv. Project metadata now uses PEP 621 and uv_build. Local setup, CI workflows, release builds, and Docker packaging use pinned uv configuration.

Changes

uv and packaging migration

Layer / File(s) Summary
Project metadata and build configuration
pyproject.toml
Project metadata, runtime dependencies, adapter extras, the dev dependency group, scripts, and the build backend now use PEP 621 and uv_build.
Local development and lock configuration
CONTRIBUTING.md, .gitignore
Development setup and commands now use uv. Ignore rules remove poetry.lock and add uv.lock.
CI dependency installation
.github/workflows/run-precommit.yml, .github/workflows/test-github-action.yml, .github/workflows/test-warehouse.yml
Workflows install dependencies and run tools through pinned, cached uv installations.
Release and container packaging
.github/workflows/release.yml, Dockerfile
Release builds use uv build, and the Docker image updates its pinned uv version.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 9327f

This PR changes the packaging and development tooling while preserving the documented extras and validating builds, tests, and container execution; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: migrating the project from Poetry to uv.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch core-1273-migrate-elementary-oss-from-poetry-to-uv

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-github-action.yml:
- Around line 70-74: Validate inputs.dbt-version before the Install dbt step
constructs package specifications or interpolates it into the shell command.
Reuse the workflow’s existing dbt-version validation mechanism, reject crafted
or unsupported values before installation, and preserve the intended unpinned
behavior when no version is provided.

In `@CONTRIBUTING.md`:
- Around line 19-26: Update the two shell command code fences in the
installation instructions after “Install uv” and “Install the project” to use
the sh language identifier, preserving their existing commands.

In `@pyproject.toml`:
- Around line 71-76: Restore the fabricspark and vertica extras in the published
package metadata and include both adapter extras in the all dependency group.
Update the relevant optional-dependencies and all definitions in pyproject.toml
so elementary-data[fabricspark], elementary-data[vertica], and /app[all]
continue to resolve through the package-extra interface.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ac971be-bb50-4707-973f-4ea7b03a2056

📥 Commits

Reviewing files that changed from the base of the PR and between a73b355 and f07b19d.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • .github/workflows/release.yml
  • .github/workflows/run-precommit.yml
  • .github/workflows/test-github-action.yml
  • .github/workflows/test-warehouse.yml
  • .gitignore
  • .pre-commit-config.yaml
  • CONTRIBUTING.md
  • Dockerfile
  • dev-requirements.txt
  • poetry.toml
  • pyproject.toml
💤 Files with no reviewable changes (3)
  • poetry.toml
  • dev-requirements.txt
  • .gitignore

Comment on lines 70 to 74
- name: Install dbt
run: >
pip install
uv pip install
"dbt-core${{ inputs.dbt-version && format('=={0}', inputs.dbt-version) }}"
"dbt-snowflake${{ inputs.dbt-version && format('~={0}', inputs.dbt-version) }}"

@coderabbitai coderabbitai Bot Aug 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the reusable workflow interface and its shell interpolation.
sed -n '1,90p' .github/workflows/test-github-action.yml

# Trace callers and determine whether dbt-version originates from trusted constants,
# validated workflow inputs, or branch-controlled values.
rg -n -C 6 --glob '*.yml' --glob '*.yaml' \
  'uses:\s*(\./)?\.github/workflows/test-github-action\.yml|dbt-version:' \
  .github/workflows

Repository: elementary-data/elementary

Length of output: 9397


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- test-github-action.yml ---'
sed -n '1,110p' .github/workflows/test-github-action.yml

printf '%s\n' '--- test-warehouse.yml version handling ---'
rg -n -C 10 'dbt-version|pip install|validate|VERSION|^[[:space:]]*on:' \
  .github/workflows/test-warehouse.yml

printf '%s\n' '--- all references to test-github-action.yml ---'
rg -n -C 8 --glob '*.yml' --glob '*.yaml' \
  'test-github-action\.yml|test-github-action' .github

printf '%s\n' '--- workflow triggers and dispatch inputs ---'
rg -n -C 5 --glob '*.yml' --glob '*.yaml' \
  'workflow_dispatch:|pull_request_target:|pull_request:|workflow_call:' .github/workflows

Repository: elementary-data/elementary

Length of output: 16630


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import subprocess

payload = '1.2"; echo INJECTED; #'
command = (
    f'uv pip install '
    f'"dbt-core=={payload}" '
    f'"dbt-snowflake~={payload}"'
)

print('Generated command:')
print(command)
syntax = subprocess.run(
    ['bash', '-n'],
    input=command + '\n',
    text=True,
    capture_output=True,
)
print(f'bash -n exit code: {syntax.returncode}')
if syntax.stderr:
    print(syntax.stderr, end='')
print('Shell command segments:')
print(command.replace(';', '\\n;'))
PY

Repository: elementary-data/elementary

Length of output: 416


🌐 Web query:

GitHub Actions workflow_dispatch who can trigger a workflow and access repository secrets permissions

💡 Result:

For GitHub Actions workflows configured with the workflow_dispatch event, here is the breakdown of who can trigger them and how they interact with repository secrets: Who Can Trigger workflow_dispatch By default, any user with write access to the repository can manually trigger a workflow configured with the workflow_dispatch event [1]. As of June 2026, organizations and enterprises can implement more granular control through workflow execution protections [2]. These features allow administrators to define allow lists for specific actors (e.g., specific users, roles such as Maintainer or Admin, or GitHub Apps) and restrict which events are permitted, effectively allowing them to limit manual triggers to specific users or roles [2]. Triggering methods include the GitHub Actions UI, GitHub CLI, or the REST API [1]. For a workflow to be eligible for manual triggering via workflow_dispatch, the workflow file must be present on the default branch [3][1]. Access to Repository Secrets Workflows triggered via workflow_dispatch have access to repository-level secrets [4]. When a workflow runs, it can reference these secrets using the secrets context (e.g., ${{ secrets.MY_SECRET }}) [4]. There are specific conditions where secrets are restricted: - Forked Repositories: Secrets are generally not passed to the runner when a workflow is triggered from a forked repository [5][4]. - Reusable Workflows: If a workflow is called as a reusable workflow (even if it also supports workflow_dispatch), secrets are not automatically passed. They must be explicitly mapped or inherited using the secrets: inherit keyword in the caller workflow [4][6]. - Dependabot: Secrets are not available to workflows triggered by Dependabot events [4]. When triggering a workflow via workflow_dispatch from another workflow (programmatically), the triggering entity must use an authenticated token (such as a Personal Access Token or a GitHub App token) with sufficient permissions—typically actions: write on the target repository [7][8].

Citations:


Validate inputs.dbt-version before shell interpolation. Any user with write access can dispatch this workflow with a crafted value that executes shell commands. The workflow also exposes CI_WAREHOUSE_SECRETS later. Apply the existing dbt-version validation before constructing the package specifications.

🧰 Tools
🪛 zizmor (1.29.0)

[error] 73-73: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 74-74: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-github-action.yml around lines 70 - 74, Validate
inputs.dbt-version before the Install dbt step constructs package specifications
or interpolates it into the shell command. Reuse the workflow’s existing
dbt-version validation mechanism, reject crafted or unsupported values before
installation, and preserve the intended unpinned behavior when no version is
provided.

Source: Linters/SAST tools

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.

Pre-existing, unchanged by this PR: only pip install -> uv pip install moved on those lines, the inputs.dbt-version interpolation is identical to master. There's no existing validation step in this workflow to reuse, so hardening it is a separate change and out of scope for the Poetry->uv migration.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

Comment thread CONTRIBUTING.md
Comment on lines 19 to +26
```
python3 -m venv venv
source venv/bin/activate
curl -LsSf https://astral.sh/uv/install.sh | sh
```

#### (3) Install requirements
#### (3) Install the project

```
pip install -r dev-requirements.txt
pip install -e .
uv sync

@coderabbitai coderabbitai Bot Aug 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add language identifiers to the shell code fences.

markdownlint-cli2 reports MD040 for both fences. Use sh after each opening fence.

Proposed fix
-```
+```sh
 curl -LsSf https://astral.sh/uv/install.sh | sh

- +sh
uv sync

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
python3 -m venv venv
source venv/bin/activate
curl -LsSf https://astral.sh/uv/install.sh | sh
```
#### (3) Install requirements
#### (3) Install the project
```
pip install -r dev-requirements.txt
pip install -e .
uv sync
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)

[warning] 19-19: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


[warning] 25-25: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 19 - 26, Update the two shell command code
fences in the installation instructions after “Install uv” and “Install the
project” to use the sh language identifier, preserving their existing commands.

Source: Linters/SAST tools

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.

Skipping: none of the existing fences in CONTRIBUTING.md declare a language, and markdownlint isn't part of the repo's pre-commit config, so adding sh to just these two would be inconsistent.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Skipped: comment is from another GitHub bot.

Comment thread pyproject.toml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment thread .pre-commit-config.yaml Outdated
Comment thread pyproject.toml
devin-ai-integration Bot and others added 3 commits August 12, 2026 21:38
Also capitalize [project.urls] labels for PyPI rendering.

Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
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.

1 participant