Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: migrate from Poetry to uv + uv-dynamic-versioning #590

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .deptry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
exclude_patterns = [
"tests/*",
"docs/*",
".venv/*",
".pytest_cache/*",
"__pycache__/*",
"*.pyc"
]

[dependencies]
# Ignore development dependencies since they are used in tests
ignore_dev = true
14 changes: 7 additions & 7 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: 3.10
enable-cache: true

- name: Install dependencies
run: poetry install
run: uv install

- name: Format code
run: poetry run ruff format .
run: ruff format .

- name: Commit changes
run: |
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/fix-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,26 @@ jobs:

[1]: ${{ steps.vars.outputs.run-url }}

- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: poetry install
run: |
uv pip install -r requirements.txt -r requirements-dev.txt
uv pip install --system ruff poethepoet

# Fix any lint or format issues

- name: Auto-Fix Ruff Lint Issues
run: poetry run ruff check --fix . || true
run: ruff check --fix . || true
- name: Auto-Fix Ruff Format Issues
run: poetry run ruff format . || true
run: ruff format . || true

# Check for changes in git

Expand All @@ -118,9 +120,9 @@ jobs:
# Fix any further 'unsafe' lint issues in a separate commit

- name: Auto-Fix Ruff Lint Issues (Unsafe)
run: poetry run ruff check --fix --unsafe-fixes . || true
run: ruff check --fix --unsafe-fixes . || true
- name: Auto-Fix Ruff Format Issues
run: poetry run ruff format . || true
run: ruff format . || true

# Check for changes in git (2nd time, for 'unsafe' lint fixes)

Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/poetry-lock-command.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: On-Demand Poetry Lock
name: On-Demand UV Lock

on:
workflow_dispatch:
Expand All @@ -16,8 +16,8 @@ env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}

jobs:
poetry-lock-on-demand:
name: On-Demand Poetry Lock
uv-lock-on-demand:
name: On-Demand UV Lock
strategy:
matrix:
python-version: [
Expand Down Expand Up @@ -66,24 +66,24 @@ jobs:
issue-number: ${{ github.event.inputs.pr }}
body: |

> `poetry lock` job started... [Check job output.][1]
> `uv pip compile` job started... [Check job output.][1]

[1]: ${{ steps.vars.outputs.run-url }}

- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

# Run `poetry lock`
# Run `uv pip compile`

- name: Run `poetry lock`
run: poetry lock
- name: Run `uv pip compile`
run: uv pip compile pyproject.toml -o requirements.txt

# Check for changes in git

Expand All @@ -101,7 +101,7 @@ jobs:
git config --global user.name "octavia-squidington-iii"
git config --global user.email "contact@airbyte.com"
git add .
git commit -m "Auto-commit `poetry lock` changes"
git commit -m "Auto-commit `uv pip compile` changes"

- name: Push changes to '(${{ steps.pr-info.outputs.repo }})'
if: steps.git-diff.outputs.changes == 'true'
Expand All @@ -116,7 +116,7 @@ jobs:
comment-id: ${{ steps.first-comment-action.outputs.comment-id }}
reactions: hooray
body: |
> ✅ `poetry lock` applied successfully.
> ✅ `uv pip compile` applied successfully.

- name: Append success comment (no-op)
uses: peter-evans/create-or-update-comment@v4
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/pydoc_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,38 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Install Git
run: |
sudo apt-get update
sudo apt-get install -y git
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: true

- name: Install dependencies
run: poetry install
shell: bash
run: |
python -m venv .venv
source .venv/bin/activate
python -m ensurepip --upgrade
python -m pip install --upgrade pip setuptools wheel build
python -m pip install poethepoet
python -m pip install -e .
uv pip install -r requirements.txt -r requirements-dev.txt
env:
PATH: ${{ github.workspace }}/.venv/bin:${{ env.PATH }}

- name: Generate documentation
env:
PATH: ${{ github.workspace }}/.venv/bin:${{ env.PATH }}
run: |
poetry run poe docs-generate
.venv/bin/poe docs-generate

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/pydoc_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,40 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Install Git
run: |
sudo apt-get update
sudo apt-get install -y git
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: true
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Install dependencies
run: poetry install
shell: bash
run: |
python -m venv .venv
source .venv/bin/activate
python -m ensurepip --upgrade
python -m pip install --upgrade pip setuptools wheel build
python -m pip install poethepoet
python -m pip install -e .
uv pip install -r requirements.txt -r requirements-dev.txt
env:
PATH: ${{ github.workspace }}/.venv/bin:${{ env.PATH }}

- name: Generate documentation
env:
PATH: ${{ github.workspace }}/.venv/bin:${{ env.PATH }}
run: |
poetry run poe docs-generate
.venv/bin/poe docs-generate

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
48 changes: 27 additions & 21 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@ jobs:
# Common steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: true
- name: Install dependencies
run: poetry install
run: |
uv pip install -r requirements.txt -r requirements-dev.txt
uv pip install --system ruff mypy

# Job-specifc step(s):
- name: Format code
run: poetry run ruff check .
run: ruff check .

ruff-format-check:
name: Ruff Format Check
Expand All @@ -40,21 +42,23 @@ jobs:
# Common steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: true
- name: Install dependencies
run: poetry install
run: |
uv pip install -r requirements.txt -r requirements-dev.txt
uv pip install --system ruff mypy

# Job-specifc step(s):
- name: Check code format
run: poetry run ruff format --check .
run: ruff format --check .

mypy-check:
name: MyPy Check
Expand All @@ -63,18 +67,20 @@ jobs:
# Common steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "1.7.1"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: true
- name: Install dependencies
run: poetry install
run: |
uv pip install -r requirements.txt -r requirements-dev.txt
uv pip install --system ruff mypy poethepoet

# Job-specifc step(s):
- name: Check MyPy typing
run: poetry run mypy .
run: mypy .
Loading
Loading