Skip to content
Merged
19 changes: 15 additions & 4 deletions .github/workflows/publish_testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
# chrome_v: ['-1']
name: Build and Test
runs-on: ${{ matrix.os }}
env:
UV_PYTHON: ${{ matrix.python_v }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -28,16 +30,18 @@ jobs:
# must actually checkout for version determination
- run: git checkout ${{ github.ref_name }}
- run: uv python install ${{ matrix.python_v }}
- run: uv python pin ${{ matrix.python_v }}
if: ${{ matrix.python_v != '' }}
# don't modify sync file! messes up version!
- run: uv sync --all-extras --locked --no-sources
- run: git status
- run: git diff --quiet HEAD || { echo "Working tree dirty"; exit 1; }
- run: uv build
- name: Reinstall from wheel
run: >
uv pip install dist/choreographer-$(uv
run --no-sync --with setuptools-git-versioning
setuptools-git-versioning)-py3-none-any.whl
- run: uv run --no-sync python --version
- run: uv pip freeze
- run: uv run --no-sync choreo_get_chrome -v #--i ${{ matrix.chrome_v }}
- name: Diagnose
run: uv run --no-sync choreo_diagnose --no-run
Expand All @@ -53,18 +57,25 @@ jobs:

- name: Test (Debug)
if: ${{ runner.debug && matrix.os != 'ubuntu-latest' }}
env:
CHOREO_ENABLE_DEBUG: 1
run: uv run --no-sync poe debug-test
timeout-minutes: 20

- name: Test (Debug, Linux)
if: ${{ runner.debug && matrix.os == 'ubuntu-latest' }}
env:
CHOREO_ENABLE_DEBUG: 1
run: xvfb-run uv run --no-sync poe debug-test
timeout-minutes: 8

testpypi-publish:
name: Upload release to TestPyPI
needs: super-test
if: ${{ !cancelled() && !failure() && github.event_name == 'push' }}
if: ${{ !cancelled() &&
!failure() &&
github.event_name == 'push' &&
github.run_attempt == 1 }}
runs-on: ubuntu-latest
environment:
name: testpypi
Expand All @@ -80,7 +91,7 @@ jobs:
with:
python-version-file: "pyproject.toml"
- run: git checkout ${{ github.ref_name }}
- run: uv sync --frozen --all-extras
- run: uv sync --locked --all-extras --no-sources
- run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ jobs:

- name: Test (Debug)
if: ${{ runner.debug && matrix.os != 'ubuntu-latest' }}
env:
CHOREO_ENABLE_DEBUG: 1
run: uv run --no-sources poe debug-test
timeout-minutes: 20

- name: Test (Debug, Linux)
if: ${{ runner.debug && matrix.os == 'ubuntu-latest' }}
env:
CHOREO_ENABLE_DEBUG: 1
run: xvfb-run uv run --no-sources poe debug-test
timeout-minutes: 7
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ ignore = [
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
log_cli = false
addopts = "--import-mode=append"

[tool.poe]
executor.type = "virtualenv"

[tool.poe.tasks]
test_proc = "pytest --log-level=1 -W error -n auto -v -rfE --capture=fd tests/test_process.py"
Expand Down
10 changes: 10 additions & 0 deletions src/choreographer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
See the main README for a quickstart.
"""

import os

if os.getenv("CHOREO_ENABLE_DEBUG"):
import sys

import logistro

logistro.betterConfig(level=1)
print("DEBUG MODE!", file=sys.stderr) # noqa: T201

from .browser_async import (
Browser,
Tab,
Expand Down
16 changes: 16 additions & 0 deletions tests/test_browser_search.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import os
import platform
import stat
import sys
from pathlib import Path

import pytest

from choreographer.browsers import chromium
from choreographer.cli._cli_utils import get_chrome_download_path


def test_internal(tmp_path):
Expand All @@ -29,3 +32,16 @@ def test_internal(tmp_path):
_p.unlink()

os.environ["PATH"] = _o


def test_canary():
# This ensures we are finding the local install
if os.getenv("TEST_SYSTEM_BROWSER"):
pytest.skip("Okay, no need to test for local.")
_r = chromium.Chromium.find_browser(skip_local=False, skip_typical=True)
print(sys.path, file=sys.stderr)
print(f"found {_r}", file=sys.stderr)
print(f"download path: {get_chrome_download_path()}", file=sys.stderr)
assert _r
assert Path(_r) == get_chrome_download_path()
# if _r != get_chrome_download_path():