diff --git a/.ci/end2end/Dockerfile b/.ci/end2end/Dockerfile index 4afd54fc..9bb8bf9a 100644 --- a/.ci/end2end/Dockerfile +++ b/.ci/end2end/Dockerfile @@ -7,7 +7,7 @@ COPY scripts /scripts RUN /scripts/setup_firefox.sh \ && /scripts/setup_chrome.sh \ && /scripts/setup_node.sh \ - && apt install --yes tox git \ + && apt install --yes pipx git \ # using python docs as a source of some html test data # need to prevent dpkg from excluding doc files... && sed -i '/usr.share.doc/d' /etc/dpkg/dpkg.cfg.d/excludes && apt install --yes python3-doc \ diff --git a/.ci/end2end/scripts/build_and_run_tests.sh b/.ci/end2end/scripts/build_and_run_tests.sh index 7dcb591a..2db90b78 100755 --- a/.ci/end2end/scripts/build_and_run_tests.sh +++ b/.ci/end2end/scripts/build_and_run_tests.sh @@ -12,4 +12,8 @@ cp -R -T /promnesia_source /promnesia extension/.ci/build git init # todo ??? otherwise setuptools-scm fails to detect the version... -python3 -m tox -e end2end -- "$@" + +# eh. kinda annoying to jump over so many venv layer here... +# but docker runs as root and it doesn't like pip install uv now +# even if you pass --break-system-packages, then subsequent uv invocation also fails +pipx run uv tool run --with=tox-uv tox -e end2end -- "$@" diff --git a/.ci/run b/.ci/run index 38070f34..060a7de8 100755 --- a/.ci/run +++ b/.ci/run @@ -11,6 +11,8 @@ if ! command -v sudo; then } fi +# --parallel-live to show outputs while it's running +tox_cmd='run-parallel --parallel-live' if [ -n "${CI-}" ]; then # install OS specific stuff here # TODO: pyjq is not necessary anymore? will keep CI deps just in case I guess @@ -25,7 +27,8 @@ if [ -n "${CI-}" ]; then ;; cygwin* | msys* | win*) # windows - : + # ugh. parallel stuff seems super flaky under windows, some random failures, "file used by other process" and crap like that + tox_cmd='run' ;; *) # must be linux? @@ -44,5 +47,9 @@ if ! command -v python3 &> /dev/null; then PY_BIN="python" fi -"$PY_BIN" -m pip install --user tox -"$PY_BIN" -m tox --parallel --parallel-live "$@" + +# TODO hmm for some reason installing uv with pip and then running +# "$PY_BIN" -m uv tool fails with missing setuptools error?? +# just uvx directly works, but it's not present in PATH... +"$PY_BIN" -m pip install --user pipx +"$PY_BIN" -m pipx run uv tool run --with=tox-uv tox $tox_cmd "$@" diff --git a/tox.ini b/tox.ini index 260df645..1c7f680b 100644 --- a/tox.ini +++ b/tox.ini @@ -26,9 +26,9 @@ passenv = WITH_BROWSER_TESTS # todo ugh this is all so confusing... need to simplify usedevelop = true # for some reason tox seems to ignore "-e ." in deps section?? -# note: --use-pep517 here is necessary for tox --parallel flag to work properly -# otherwise it seems that it tries to modify .eggs dir in parallel and it fails -install_command = {envpython} -m pip install --use-pep517 {opts} {packages} +setenv = + HPI_MODULE_INSTALL_USE_UV=true +uv_seed = true # seems necessary so uv creates separate venvs per tox env? [testenv:ruff] @@ -54,6 +54,7 @@ commands = [testenv:tests-all] deps = -e .[testing,all,HPI,org] + uv # for hpi module install commands = # used in some tests {envpython} -m my.core module install \ @@ -70,6 +71,7 @@ setenv = PYTEST_TIMEOUT=120 deps = -e .[testing,HPI] + uv # for hpi module install commands = {envpython} -m my.core module install my.hypothesis {envpython} -m pytest \ @@ -83,6 +85,7 @@ commands = [testenv:mypy-core] deps = -e .[testing] + uv # for hpi module install commands = {envpython} -m mypy --install-types --non-interactive \ # note: sources are tested separately, below @@ -96,6 +99,7 @@ commands = [testenv:mypy-misc] deps = -e .[testing,HPI,org] # todo install from HPI[all] or something? + uv # for hpi module install commands = {envpython} -m my.core module install \ my.github.ghexport \