Skip to content

Require pip 20.3 for dependency inspection #3665

Require pip 20.3 for dependency inspection

Require pip 20.3 for dependency inspection #3665

Workflow file for this run

name: main
on:
push:
branches: [main]
tags: ['*']
schedule:
- cron: "0 09 * * *" # Runs 11 AM UTC == 2 AM PDT
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
test-python-versions:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
include:
- os: macos-latest
python-version: '3.13'
- os: macos-latest
python-version: '3.14'
- os: windows-latest
python-version: '3.13'
- os: windows-latest
python-version: '3.14'
runs-on: ${{ matrix.os }}
name: test (py${{ matrix.python-version }} ${{ matrix.os }})
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ">=0.9.0"
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
# Fail fast if uv.lock has drifted from pyproject.toml.
- run: uv lock --locked
- run: just lint
- run: uv run --python ${{ matrix.python-version }} --group test rsconnect version
- run: just test ${{ matrix.python-version }}
- if: github.event_name == 'pull_request' && matrix.python-version == '3.8'
uses: orgoro/coverage@d77626a5fa35d39123e86d6c62907fabe2491496 # v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
prerelease-test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ">=0.9.0"
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- run: just lint
# --upgrade forces a fresh resolve (ignoring the lock) so prereleases are
# actually exercised; plain `--prerelease allow` against the lock is a no-op.
- run: uv run --upgrade --prerelease allow --group test rsconnect version
- run: uv run --python 3.8 --upgrade --prerelease allow --group test ./scripts/runtests
distributions:
needs: test-python-versions
strategy:
matrix:
package_name: ["rsconnect_python", "rsconnect"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ">=0.9.0"
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- run: uv sync --group test
- name: assert tag matches pyproject version
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
tag="${GITHUB_REF_NAME}"
ver="$(uv version --short)"
if [ "$tag" != "$ver" ]; then
echo "::error::tag '$tag' does not match pyproject version '$ver'"
exit 1
fi
- name: assert tag is on main
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
if ! git merge-base --is-ancestor HEAD origin/main; then
echo "::error::tag '${GITHUB_REF_NAME}' points to a commit that is not on main"
exit 1
fi
- run: just dist
env:
PACKAGE_NAME: ${{ matrix.package_name }}
- name: assert wheel contents
run: |
WHL=$(ls dist/*.whl | head -1)
unzip -l "$WHL" | grep -q 'rsconnect/py.typed' || { echo "::error::py.typed missing from wheel"; exit 1; }
unzip -l "$WHL" | grep -q 'rsconnect/quickstart/templates/' || { echo "::error::quickstart templates missing from wheel"; exit 1; }
if unzip -l "$WHL" | grep -qE ' (tests/|conftest\.py)'; then echo "::error::wheel contains test files"; exit 1; fi
- name: smoke test the built wheel
run: |
WHL=$(ls dist/*.whl | head -1)
uv run --no-project --with "$WHL" rsconnect version
uv run --no-project --with "$WHL" rsconnect --help
- name: create github release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.package_name == 'rsconnect_python'
with:
files: |
dist/*.whl
token: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
docs:
needs: test-python-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ">=0.9.0"
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0
- name: build docs
run: just docs
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: docs
path: site/
- uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
id: creds
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: just sync-latest-docs-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
with:
role-to-assume: ${{ secrets.DOCS_AWS_ROLE }}
aws-region: us-east-1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: just promote-docs-in-s3
test-connect-versions:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "preview" # nightly pre-release build of Connect
- "release" # special value that always points to the latest Connect release
- "2025.09.0" # jammy
- "2025.03.0" # jammy
- "2024.09.0" # jammy
- "2024.03.0" # jammy
- "2023.09.0" # jammy
- "2023.03.0" # bionic
- "2022.10.0" # bionic
name: Integration tests against Connect ${{ matrix.version }}
env:
python-version: '3.13'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version: ">=0.9.0"
# Prepare the environment on the runner BEFORE entering with-connect, so
# no build/resolve/interpreter-fetch happens over the network mid-test.
- run: uv sync --python ${{ env.python-version }} --group test
- run: uv run --no-sync rsconnect version
- name: Run integration tests
uses: posit-dev/with-connect@0783dabdd24e360e985a4588ce1239c3dc31c542 # main
with:
version: ${{ matrix.version }}
# License file valid until 2026-12-05
license: ${{ secrets.CONNECT_LICENSE_FILE }}
command: |
uv run --no-sync --group test ./scripts/runtests