🚀 ci: cross-platform venv python resolution in wheel test (Scripts/ vs bin/)

swadhinbiswas committed 2 months ago
905df9e
1 parent a9534e5
commit 905df9e
1 file changed
+5 -3
Showing 1 changed file+5-3
▼.github/workflows/wheels.yml
+5-3
156
156
working-directory: crates/justapi-py
157
157
run: |
158
158
uv venv --python ${{ matrix.python || '3.12' }} "$RUNNER_TEMP/wtest"
159
- uv pip install --python "$RUNNER_TEMP/wtest/bin/python" dist/*.whl
160
- uv pip install --python "$RUNNER_TEMP/wtest/bin/python" pytest pytest-asyncio requests pydantic jinja2 websockets
161
- "$RUNNER_TEMP/wtest/bin/python" -m pytest tests/ -v --tb=short
159
+ # `uv run --directory` resolves the venv python on all platforms
160
+ # (Scripts/ on Windows, bin/ on Unix).
161
+ uv pip install --python "$(uv run --directory "$RUNNER_TEMP/wtest" python -c 'import sys; print(sys.executable)')" dist/*.whl
162
+ uv pip install --python "$(uv run --directory "$RUNNER_TEMP/wtest" python -c 'import sys; print(sys.executable)')" pytest pytest-asyncio requests pydantic jinja2 websockets
163
+ "$(uv run --directory "$RUNNER_TEMP/wtest" python -c 'import sys; print(sys.executable)')" -m pytest tests/ -v --tb=short
162
164
- name: Upload Wheels
163
165
uses: actions/upload-artifact@v4
164
166
with:
165
167