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

chore: Do not use poetry.lock in CI #2630

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
11 changes: 6 additions & 5 deletions .github/workflows/api-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ jobs:
with:
python-version: 3.12

- uses: hynek/[email protected]

- name: Install tools
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
python -Im pip install -U pip
pipx install griffe nox
pipx inject nox nox-poetry
pipx list
uv tool install griffe
uv tool install nox
uv tool list

- name: Set REF
id: set-ref
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ on:
- "singer_sdk/**"
- "tests/**"
- "noxfile.py"
- "poetry.lock"
- "pyproject.toml"
- ".github/workflows/codspeed.yml"
pull_request:
paths:
- "singer_sdk/**"
- "tests/**"
- "noxfile.py"
- "poetry.lock"
- "pyproject.toml"
- ".github/workflows/codspeed.yml"
# `workflow_dispatch` allows CodSpeed to trigger backtest
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
griffe==1.2.0
pip==24.2
poetry==1.8.3
poetry-plugin-export==1.8.0
poetry-dynamic-versioning==1.4.0
pre-commit==3.8.0
nox==2024.4.15
nox-poetry==1.0.3
33 changes: 12 additions & 21 deletions .github/workflows/cookiecutter-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,31 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pip install pip
pip --version
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- uses: hynek/[email protected]

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
uv tool install poetry
poetry --version
poetry self show plugins

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'poetry.lock'

- name: Install pre-commit
env:
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install pre-commit
uv tool install pre-commit
pre-commit --version

- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install nox
pipx inject nox nox-poetry
uv tool install nox
nox --version

- name: Run Nox
Expand Down
71 changes: 10 additions & 61 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- "singer_sdk/**"
- "tests/**"
- "noxfile.py"
- "poetry.lock"
- "pyproject.toml"
- ".github/workflows/test.yml"
- ".github/workflows/constraints.txt"
Expand All @@ -21,7 +20,6 @@ on:
- "singer_sdk/**"
- "tests/**"
- "noxfile.py"
- "poetry.lock"
- "pyproject.toml"
- ".github/workflows/test.yml"
- ".github/workflows/constraints.txt"
Expand Down Expand Up @@ -61,34 +59,17 @@ jobs:
with:
fetch-depth: 0

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
pipx inject poetry poetry-dynamic-versioning[plugin]
poetry --version
poetry self show plugins

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pip install pip
pip --version
- uses: hynek/[email protected]

- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install 'nox[uv]'
pipx inject nox nox-poetry
nox --version
uv pip install --system nox

- name: Run Nox
env:
Expand Down Expand Up @@ -119,33 +100,16 @@ jobs:
with:
fetch-depth: 0

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
pipx inject poetry poetry-dynamic-versioning[plugin]
poetry --version
poetry self show plugins

- uses: actions/setup-python@v5
with:
python-version: ${{ env.NOXPYTHON }}

- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pip install pip
pip --version

- uses: hynek/[email protected]
- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install 'nox[uv]'
pipx inject nox nox-poetry
uv tool install nox
nox --version

- name: Run Nox
Expand All @@ -161,37 +125,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
poetry --version
poetry self show plugins

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pip install pip
pip --version

- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true

- uses: hynek/[email protected]

- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install 'nox[uv]'
pipx inject nox nox-poetry
uv tool install nox
nox --version

- run: nox --install-only
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Local Poetry configuration file
# Local Poetry configuration

poetry.lock
poetry.toml

# CI
Expand Down
1 change: 0 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ With `pipx` installed, you globally add the required tools:
pipx install poetry
pipx install pre-commit
pipx install nox
pipx inject nox nox-poetry
```

Now you can use Poetry to install package dependencies:
Expand Down
31 changes: 7 additions & 24 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@
import sys
import tempfile
from pathlib import Path
from textwrap import dedent

import nox

try:
from nox_poetry import Session, session
except ImportError:
message = f"""\
Nox failed to import the 'nox-poetry' package.
Please install it using the following command:
{sys.executable} -m pip install nox-poetry"""
raise SystemExit(dedent(message)) from None
from nox import Session, session

nox.needs_version = ">=2024.4.15"
nox.options.default_venv_backend = "uv|virtualenv"
Expand Down Expand Up @@ -66,13 +57,8 @@ def tests(session: Session) -> None:
session.install(".[faker,jwt,parquet,s3]")
session.install(*test_dependencies)

sqlalchemy_version = os.environ.get("SQLALCHEMY_VERSION")
if sqlalchemy_version:
# Bypass nox-poetry use of --constraint so we can install a version of
# SQLAlchemy that doesn't match what's in poetry.lock.
session.poetry.session.install( # type: ignore[attr-defined]
f"sqlalchemy=={sqlalchemy_version}.*",
)
if sqlalchemy_version := os.environ.get("SQLALCHEMY_VERSION"):
session.install(f"sqlalchemy=={sqlalchemy_version}.*")

env = {"COVERAGE_CORE": "sysmon"} if session.python == "3.12" else {}

Expand All @@ -98,13 +84,10 @@ def benches(session: Session) -> None:
"""Run benchmarks."""
session.install(".[jwt,s3]")
session.install(*test_dependencies)
sqlalchemy_version = os.environ.get("SQLALCHEMY_VERSION")
if sqlalchemy_version:
# Bypass nox-poetry use of --constraint so we can install a version of
# SQLAlchemy that doesn't match what's in poetry.lock.
session.poetry.session.install( # type: ignore[attr-defined]
f"sqlalchemy=={sqlalchemy_version}",
)

if sqlalchemy_version := os.environ.get("SQLALCHEMY_VERSION"):
session.install(f"sqlalchemy=={sqlalchemy_version}")

session.run(
"pytest",
"--benchmark-only",
Expand Down
Loading
Loading