Skip to content

Commit

Permalink
Revert "Use default latest Python for extra sessions"
Browse files Browse the repository at this point in the history
This reverts commit a03bae8.
  • Loading branch information
edgarrmondragon committed Oct 17, 2024
1 parent a03bae8 commit c76b915
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ env:

jobs:
tests:
name: "Test on ${{ matrix.python-version || '3.x' }} (${{ matrix.session }}) / ${{ matrix.os }} / SQLAlchemy: ${{ matrix.sqlalchemy }}"
name: "Test on ${{ matrix.python-version }} (${{ matrix.session }}) / ${{ matrix.os }} / SQLAlchemy: ${{ matrix.sqlalchemy }}"
runs-on: ${{ matrix.os }}
continue-on-error: true
env:
NOXPYTHON: ${{ matrix.python-version }}
NOXSESSION: ${{ matrix.session }}
strategy:
fail-fast: false
Expand All @@ -56,20 +57,19 @@ jobs:
- "3.13"
sqlalchemy: ["2"]
include:
- { session: tests, os: "ubuntu-latest", sqlalchemy: "1" }
- { session: doctest, os: "ubuntu-latest", sqlalchemy: "2" }
- { session: mypy, os: "ubuntu-latest", sqlalchemy: "2" }
- { session: deps, os: "ubuntu-latest", sqlalchemy: "2" }
- { session: tests, python-version: "3.13", os: "ubuntu-latest", sqlalchemy: "1" }
- { session: doctest, python-version: "3.13", os: "ubuntu-latest", sqlalchemy: "2" }
- { session: mypy, python-version: "3.12", os: "ubuntu-latest", sqlalchemy: "2" }
- { session: deps, python-version: "3.12", os: "ubuntu-latest", sqlalchemy: "2" }

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version || '3.x' }}
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Upgrade pip
Expand All @@ -94,7 +94,6 @@ jobs:

- name: Run Nox
env:
NOXFORCEPYTHON: ${{ steps.setup-python.outputs.python-version }}
SQLALCHEMY_VERSION: ${{ matrix.sqlalchemy }}
PIP_PRE: "1"
UV_PRERELEASE: allow
Expand All @@ -113,6 +112,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
env:
NOXPYTHON: "3.12"
NOXSESSION: tests
SAMPLE_TAP_GITLAB_AUTH_TOKEN: ${{ secrets.SAMPLE_TAP_GITLAB_AUTH_TOKEN }}
SAMPLE_TAP_GITLAB_GROUP_IDS: ${{ secrets.SAMPLE_TAP_GITLAB_GROUP_IDS }}
Expand All @@ -125,9 +125,8 @@ jobs:
fetch-depth: 0

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

- name: Upgrade pip
env:
Expand All @@ -145,7 +144,6 @@ jobs:
- name: Run Nox
env:
NOXFORCEPYTHON: ${{ steps.setup-python.outputs.python-version }}
PIP_PRE: "1"
UV_PRERELEASE: allow
run: |
Expand All @@ -161,7 +159,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: '3.x'

- name: Upgrade pip
env:
Expand Down
17 changes: 9 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"3.9",
"3.8",
]
main_python_version = "3.12"
locations = "singer_sdk", "tests", "noxfile.py", "docs/conf.py"
nox.options.sessions = (
"mypy",
Expand All @@ -46,7 +47,7 @@
typing_dependencies = poetry_config["group"]["typing"]["dependencies"].keys()


@nox.session()
@nox.session(python=main_python_version)
def mypy(session: nox.Session) -> None:
"""Check types with mypy."""
args = session.posargs or ["singer_sdk"]
Expand Down Expand Up @@ -97,7 +98,7 @@ def tests(session: nox.Session) -> None:
session.notify("coverage", posargs=[])


@nox.session()
@nox.session(python=main_python_version)
def benches(session: nox.Session) -> None:
"""Run benchmarks."""
session.install(".[jwt,s3]")
Expand All @@ -113,15 +114,15 @@ def benches(session: nox.Session) -> None:
)


@nox.session(name="deps")
@nox.session(name="deps", python=main_python_version)
def dependencies(session: nox.Session) -> None:
"""Check issues with dependencies."""
session.install(".[s3,testing]")
session.install("deptry")
session.run("deptry", "singer_sdk", *session.posargs)


@nox.session()
@nox.session(python=main_python_version)
def update_snapshots(session: nox.Session) -> None:
"""Update pytest snapshots."""
args = session.posargs or ["-m", "snapshot"]
Expand All @@ -146,7 +147,7 @@ def doctest(session: nox.Session) -> None:
session.run("pytest", "--xdoctest", *args)


@nox.session()
@nox.session(python=main_python_version)
def coverage(session: nox.Session) -> None:
"""Generate coverage report."""
args = session.posargs or ["report", "-m"]
Expand All @@ -159,7 +160,7 @@ def coverage(session: nox.Session) -> None:
session.run("coverage", *args)


@nox.session(name="docs")
@nox.session(name="docs", python=main_python_version)
def docs(session: nox.Session) -> None:
"""Build the documentation."""
args = session.posargs or ["docs", "build", "-W"]
Expand All @@ -175,7 +176,7 @@ def docs(session: nox.Session) -> None:
session.run("sphinx-build", *args)


@nox.session(name="docs-serve")
@nox.session(name="docs-serve", python=main_python_version)
def docs_serve(session: nox.Session) -> None:
"""Build the documentation."""
args = session.posargs or [
Expand All @@ -198,7 +199,7 @@ def docs_serve(session: nox.Session) -> None:


@nox.parametrize("replay_file_path", COOKIECUTTER_REPLAY_FILES)
@nox.session()
@nox.session(python=main_python_version)
def test_cookiecutter(session: nox.Session, replay_file_path: str) -> None:
"""Uses the tap template to build an empty cookiecutter.
Expand Down

0 comments on commit c76b915

Please sign in to comment.