Skip to content

Commit

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

jobs:
tests:
name: "Test on ${{ matrix.python-version }} (${{ matrix.session }}) / ${{ matrix.os }} / SQLAlchemy: ${{ matrix.sqlalchemy }}"
name: "Test on ${{ matrix.python-version || '3.x' }} (${{ 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 @@ -57,19 +56,20 @@ jobs:
- "3.13"
sqlalchemy: ["2"]
include:
- { 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" }
- { 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" }

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

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

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

- name: Run Nox
env:
NOXFORCEPYTHON: ${{ steps.setup-python.outputs.python-version }}
SQLALCHEMY_VERSION: ${{ matrix.sqlalchemy }}
PIP_PRE: "1"
UV_PRERELEASE: allow
Expand All @@ -112,7 +113,6 @@ 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,8 +125,9 @@ jobs:
fetch-depth: 0

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

- name: Upgrade pip
env:
Expand All @@ -144,6 +145,7 @@ jobs:
- name: Run Nox
env:
NOXPYTHON: ${{ steps.setup-python.outputs.python-version }}
PIP_PRE: "1"
UV_PRERELEASE: allow
run: |
Expand All @@ -159,7 +161,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: 8 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"3.9",
"3.8",
]
main_python_version = "3.12"
locations = "singer_sdk", "tests", "noxfile.py", "docs/conf.py"
nox.options.sessions = (
"mypy",
Expand All @@ -47,7 +46,7 @@
typing_dependencies = poetry_config["group"]["typing"]["dependencies"].keys()


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


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


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


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


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


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


@nox.parametrize("replay_file_path", COOKIECUTTER_REPLAY_FILES)
@nox.session(python=main_python_version)
@nox.session()
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 6fb4108

Please sign in to comment.