Skip to content

Commit 16c4c77

Browse files
committed
sentencepiece: run tests closer to upstream
Copy python/tools alongside python/test so gen_stubs_test can import gen_stubs, and drop the ad-hoc pytest ignores to mirror upstream's 'pytest -v {project}/test'. Signed-off-by: Bruno Verachten <gounthar@gmail.com>
1 parent 884e4eb commit 16c4c77

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/build-sentencepiece.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ jobs:
5656
CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64
5757
CIBW_BUILD_VERBOSITY: 1
5858
CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=8
59-
# test-sources are resolved relative to the checkout root, so the
60-
# path is prefixed with python/. gen_stubs_test imports a repo-level
61-
# helper module that is not part of the copied test tree, and the
62-
# manual cleanup script is not a pytest module; both are skipped.
63-
CIBW_TEST_SOURCES: python/test
64-
CIBW_TEST_COMMAND: >-
65-
pytest -v python/test
66-
--ignore=python/test/gen_stubs_test.py
67-
--ignore=python/test/clean_sentencepiece_test_manual.py
59+
# Mirror upstream's `test-command = "pytest -v {project}/test"`.
60+
# test-sources are resolved relative to the checkout root (hence the
61+
# python/ prefix); tools/ is copied alongside test/ because
62+
# gen_stubs_test inserts ../tools on sys.path to import gen_stubs.
63+
# test-requires (pytest, numpy, protobuf) come from the project's own
64+
# [tool.cibuildwheel] table in python/pyproject.toml.
65+
CIBW_TEST_SOURCES: python/test python/tools
66+
CIBW_TEST_COMMAND: pytest -v python/test
6867

6968
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7069
with:

0 commit comments

Comments
 (0)