Skip to content

Commit

Permalink
uv: use for CI and releasing main package
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Jan 18, 2025
1 parent 7a196c1 commit d04a7e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
16 changes: 6 additions & 10 deletions .ci/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
case "$OSTYPE" in
Expand All @@ -20,7 +22,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?
Expand All @@ -29,12 +32,5 @@ if [ -n "${CI-}" ]; then
esac
fi


PY_BIN="python3"
# some systems might have python pointing to python3
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 "$@"
# NOTE: expects uv installed
uv tool run --with tox-uv tox $tox_cmd "$@"
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: astral-sh/setup-uv@v5

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -87,6 +89,4 @@ jobs:
# always deploy tags to release pypi
# NOTE: release tags are guarded by on: push: tags on the top
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: pip3 install --user --upgrade build twine && .ci/release
run: .ci/release-uv
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ passenv =
MYPY_CACHE_DIR
RUFF_CACHE_DIR
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}
uv_seed = true # seems necessary so uv creates separate venvs per tox env?


[testenv:ruff]
Expand Down

0 comments on commit d04a7e2

Please sign in to comment.