Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on CI that update-meson is properly ran #39527

Merged
merged 7 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci-meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ jobs:
# Use --no-deps and pip check below to verify that all necessary dependencies are installed via conda
pip install --no-build-isolation --no-deps --config-settings=builddir=builddir . -v

- name: Check update-meson
# this step must be after build, because meson.build creates a number of __init__.py files
# that is needed to make tools/update-meson.py run correctly
shell: bash -l {0}
run: |
python3 tools/update-meson.py
if ! ./tools/test-git-no-uncommitted-changes; then
git add --intent-to-add . # also show newly created files in git diff
git status
git diff
false
fi

- name: Verify dependencies
shell: bash -l {0}
run: pip check
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,8 @@ src/sage/libs/mpfr/__init__.py
src/sage/libs/mpc/__init__.py
src/sage/calculus/transforms/__init__.py
src/sage/calculus/__init__.py

# Temporary files generated by Meson CI (needed to make test pass because
# ci-meson.yml runs a `./tools/test-git-no-uncommitted-changes` step)
/.ccache
/setup-miniconda-patched-environment-*.yml
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,7 @@ TEST_TARGET = $@
TEST = ./sage -t --logfile=$(TEST_LOG) $(TEST_FLAGS) --optional=$(TEST_OPTIONAL) $(TEST_FILES)

test-git-no-uncommitted-changes:
@UNCOMMITTED=$$(git status --porcelain); \
if [ -n "$$UNCOMMITTED" ]; then \
echo "Error: the git repo has uncommitted changes:"; \
echo "$$UNCOMMITTED"; \
echo; \
exit 1; \
fi
./tools/test-git-no-uncommitted-changes

test: all
@echo '### make $(TEST_TARGET): Running $(TEST)' >> $(TEST_LOG)
Expand Down
4 changes: 1 addition & 3 deletions src/sage/data_structures/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ foreach name, pyx : extension_data
)
endforeach

extension_data_cpp = {
'pairing_heap' : files('pairing_heap.pyx'),
}
extension_data_cpp = {'pairing_heap' : files('pairing_heap.pyx')}

foreach name, pyx : extension_data_cpp
py.extension_module(
Expand Down
10 changes: 10 additions & 0 deletions tools/test-git-no-uncommitted-changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
# Test that there is no uncommitted changes in the repository. Return failure if there is.
# Can also be invoked with `make test-git-no-uncommitted-changes` from top level.
UNCOMMITTED="$(git status --porcelain)";
if [ -n "$UNCOMMITTED" ]; then
echo "Error: the git repo has uncommitted changes:";
echo "$UNCOMMITTED";
echo;
exit 1;
fi
Loading