mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-04-18 20:22:27 +02:00
51 lines
1.5 KiB
Diff
51 lines
1.5 KiB
Diff
From 14c571b9b72a7b7e429189a9455fc715e6f0dbce Mon Sep 17 00:00:00 2001
|
|
From: Andrzej Klajnert <github@aklajnert.pl>
|
|
Date: Sun, 22 Mar 2026 08:46:44 +0100
|
|
Subject: [PATCH] Fix tests executed via uv (#202)
|
|
|
|
* Add GitHub Actions workflow for testing in uv virtual environment
|
|
|
|
* Fix test to use the current Python executable name
|
|
---
|
|
.github/workflows/ci.yml | 12 ++++++++++++
|
|
README.rst | 3 ++-
|
|
2 files changed, 14 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
|
|
index 42a57f2..80eb12b 100644
|
|
--- a/.github/workflows/ci.yml
|
|
+++ b/.github/workflows/ci.yml
|
|
@@ -34,6 +34,18 @@ jobs:
|
|
PLATFORM: ${{ matrix.platform }}
|
|
|
|
|
|
+ test-uv-venv:
|
|
+ runs-on: ubuntu-latest
|
|
+ steps:
|
|
+ - uses: actions/checkout@v3
|
|
+ - name: Install uv
|
|
+ uses: astral-sh/setup-uv@v5
|
|
+ - name: Run tests inside uv venv
|
|
+ run: |
|
|
+ uv venv -p 3.12
|
|
+ uv pip install -e .[test]
|
|
+ uv run pytest
|
|
+
|
|
mypy:
|
|
runs-on: ubuntu-latest
|
|
|
|
diff --git a/README.rst b/README.rst
|
|
index c023d44..39293b9 100644
|
|
--- a/README.rst
|
|
+++ b/README.rst
|
|
@@ -311,7 +311,8 @@ the same name, regardless of the location. This is accomplished with
|
|
|
|
def test_any_matching_program(fp):
|
|
# define a command that can come from anywhere
|
|
- fp.register([fp.program("python")])
|
|
+ executable_name = os.path.basename(sys.executable)
|
|
+ fp.register([fp.program(executable_name)])
|
|
assert subprocess.check_call(sys.executable) == 0
|
|
|
|
|