Skip to content

Commit cee1e2b

Browse files
author
Release Manager
committed
sagemathgh-39527: Test on CI that update-meson is properly ran
Fixes sagemath#39172 Side note, can we just include the `__init__.py` to be tracked by git? ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. (not applicable) - [x] I have updated the documentation and checked the documentation preview. (no documentation change? Do we need to mention this in developer guide somewhere?) ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#39527 Reported by: user202729 Reviewer(s): Tobias Diez, user202729
2 parents a007379 + 6bf8c80 commit cee1e2b

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

.github/workflows/ci-meson.yml

+13
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ jobs:
7272
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda
7373
pip install --no-build-isolation --no-deps --config-settings=builddir=builddir . -v
7474
75+
- name: Check update-meson
76+
# this step must be after build, because meson.build creates a number of __init__.py files
77+
# that is needed to make tools/update-meson.py run correctly
78+
shell: bash -l {0}
79+
run: |
80+
python3 tools/update-meson.py
81+
if ! ./tools/test-git-no-uncommitted-changes; then
82+
git add --intent-to-add . # also show newly created files in git diff
83+
git status
84+
git diff
85+
false
86+
fi
87+
7588
- name: Verify dependencies
7689
shell: bash -l {0}
7790
run: pip check

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -466,3 +466,8 @@ src/sage/libs/mpfr/__init__.py
466466
src/sage/libs/mpc/__init__.py
467467
src/sage/calculus/transforms/__init__.py
468468
src/sage/calculus/__init__.py
469+
470+
# Temporary files generated by Meson CI (needed to make test pass because
471+
# ci-meson.yml runs a `./tools/test-git-no-uncommitted-changes` step)
472+
/.ccache
473+
/setup-miniconda-patched-environment-*.yml

Makefile

+1-7
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,7 @@ TEST_TARGET = $@
254254
TEST = ./sage -t --logfile=$(TEST_LOG) $(TEST_FLAGS) --optional=$(TEST_OPTIONAL) $(TEST_FILES)
255255

256256
test-git-no-uncommitted-changes:
257-
@UNCOMMITTED=$$(git status --porcelain); \
258-
if [ -n "$$UNCOMMITTED" ]; then \
259-
echo "Error: the git repo has uncommitted changes:"; \
260-
echo "$$UNCOMMITTED"; \
261-
echo; \
262-
exit 1; \
263-
fi
257+
./tools/test-git-no-uncommitted-changes
264258

265259
test: all
266260
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)

src/sage/data_structures/meson.build

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ foreach name, pyx : extension_data
4242
)
4343
endforeach
4444

45-
extension_data_cpp = {
46-
'pairing_heap' : files('pairing_heap.pyx'),
47-
}
45+
extension_data_cpp = {'pairing_heap' : files('pairing_heap.pyx')}
4846

4947
foreach name, pyx : extension_data_cpp
5048
py.extension_module(

tools/test-git-no-uncommitted-changes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env sh
2+
# Test that there is no uncommitted changes in the repository. Return failure if there is.
3+
# Can also be invoked with `make test-git-no-uncommitted-changes` from top level.
4+
UNCOMMITTED="$(git status --porcelain)";
5+
if [ -n "$UNCOMMITTED" ]; then
6+
echo "Error: the git repo has uncommitted changes:";
7+
echo "$UNCOMMITTED";
8+
echo;
9+
exit 1;
10+
fi

0 commit comments

Comments
 (0)