Skip to content

Commit

Permalink
gh-39527: Test on CI that update-meson is properly ran
Browse files Browse the repository at this point in the history
    
Fixes #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,
-->
<!-- - #12345: short description why this is a dependency -->
<!-- - #34567: ... -->
    
URL: #39527
Reported by: user202729
Reviewer(s): Tobias Diez, user202729
  • Loading branch information
Release Manager committed Feb 21, 2025
2 parents a007379 + 6bf8c80 commit cee1e2b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
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 @@ -466,3 +466,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

0 comments on commit cee1e2b

Please sign in to comment.