diff --git a/.github/workflows/patchright_tests.yml b/.github/workflows/patchright_tests.yml index 35816be..fe081aa 100644 --- a/.github/workflows/patchright_tests.yml +++ b/.github/workflows/patchright_tests.yml @@ -38,7 +38,7 @@ jobs: uv sync --all-groups PLAYWRIGHT_TAG="${{ inputs.playwright_version || github.event.inputs.playwright_version }}" if [ -z "$PLAYWRIGHT_TAG" ]; then - PLAYWRIGHT_TAG=$(curl -fsSL "https://api.github.com/repos/microsoft/playwright-python/releases/latest" | jq -r '.tag_name') + PLAYWRIGHT_TAG=$(curl -fsSL "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r '.tag_name') else PLAYWRIGHT_TAG="v${PLAYWRIGHT_TAG#v}" fi diff --git a/pyproject.toml b/pyproject.toml index 8da1024..12280ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,20 @@ -# Only for test Runs, does not relate to actual Patchright package +[build-system] +requires = ["setuptools>=61.0", "setuptools-scm>=9"] +build-backend = "setuptools.build_meta" + [project] -name = "patchright-tests" -version = "1.0.0" +name = "patchright" +dynamic = ["version"] +description = "Undetected Python version of the Playwright testing and automation library." requires-python = ">=3.11" -dependencies = [ - "patchright>=1.59.1", -] + +[tool.setuptools] +packages = [] + +[tool.setuptools_scm] + +[tool.uv] +package = false [tool.pytest.ini_options] addopts = "-Wall -rsx" # -s diff --git a/utils/release_version_check.sh b/utils/release_version_check.sh index f4d81ac..ae1d05b 100644 --- a/utils/release_version_check.sh +++ b/utils/release_version_check.sh @@ -46,6 +46,14 @@ echo "Latest release of the Patchright-Python: $patchright_version" # Compare the versions if version_is_behind "$patchright_version" "$playwright_version"; then + playwright_minor=${playwright_version#v} + playwright_minor=${playwright_minor%.*} + driver_releases=$(curl -fsSL "https://api.github.com/repos/Kaliiiiiiiiii-Vinyzu/patchright/releases?per_page=100") || exit 1 + if ! jq -e --arg minor "$playwright_minor" 'any(.[].tag_name | ltrimstr("v"); startswith($minor + ".") and (try (split(".") | map(tonumber) | length == 3) catch false))' <<< "$driver_releases" >/dev/null; then + echo "Patchright driver release for Playwright $playwright_version is not available yet. Skipping release." + echo "proceed=false" >>$GITHUB_OUTPUT + exit 0 + fi echo "$REPO is behind microsoft/playwright-python. Building & Patching..." echo "proceed=true" >>$GITHUB_OUTPUT echo "playwright_version=$playwright_version" >>$GITHUB_ENV