diff --git a/tools/check.sh b/.dev-tools/linting/check-filenames-permalinks.sh similarity index 100% rename from tools/check.sh rename to .dev-tools/linting/check-filenames-permalinks.sh diff --git a/tools/check-image-names.py b/.dev-tools/linting/check-image-names.py similarity index 100% rename from tools/check-image-names.py rename to .dev-tools/linting/check-image-names.py diff --git a/tools/check-links-to-precice.sh b/.dev-tools/linting/check-links-to-precice.sh similarity index 100% rename from tools/check-links-to-precice.sh rename to .dev-tools/linting/check-links-to-precice.sh diff --git a/tools/check-size.sh b/.dev-tools/linting/check-size.sh similarity index 100% rename from tools/check-size.sh rename to .dev-tools/linting/check-size.sh diff --git a/tools/releasing/README.md b/.dev-tools/releasing/README.md similarity index 61% rename from tools/releasing/README.md rename to .dev-tools/releasing/README.md index fc0741a86..5389adf5a 100644 --- a/tools/releasing/README.md +++ b/.dev-tools/releasing/README.md @@ -1,5 +1,13 @@ # Releasing helpers +## Config visualization + +The `visualize-configs.sh` script iterates over all tutorial cases and updates the visualizations of the `precice-config.xml` files. + +Run it from the root tutorials directory in serial (`./visualize-configs.sh`) or in parallel (`./visualize-configs.sh -parallel`). + +If not already available, the script will install the `precice-config-visualizer` in a Python virtual environment. + ## Python dependency reference files Each Python participant lists dependencies in its local `requirements.txt` using loose version ranges (for example `numpy >1, <2`, `pyprecice~=3.0`). Tutorial `run.sh` scripts install from these files as before. @@ -10,20 +18,20 @@ Next to each `requirements.txt`, a sibling `requirements-reference.txt` records pip install -r requirements-reference.txt ``` -This tool lives under `tools/releasing/` and depends on: +This tool lives under `.dev-tools/releasing/` and depends on: ```bash -pip install -r tools/releasing/requirements.txt +pip install -r .dev-tools/releasing/requirements.txt ``` Update reference files after changing `requirements.txt` files. By default, only files whose resolved package pins changed are rewritten (timestamps alone do not create a diff). Use `--all` to force a full refresh, or pass a path to limit the update to one directory: ```bash -python3 tools/releasing/update-requirements-reference.py -python3 tools/releasing/update-requirements-reference.py path/to/participant -python3 tools/releasing/update-requirements-reference.py --all -python3 tools/releasing/update-requirements-reference.py --check -python3 tools/releasing/update-requirements-reference.py --check --fail-on-outdated +python3 .dev-tools/releasing/update-requirements-reference.py +python3 .dev-tools/releasing/update-requirements-reference.py path/to/participant +python3 .dev-tools/releasing/update-requirements-reference.py --all +python3 .dev-tools/releasing/update-requirements-reference.py --check +python3 .dev-tools/releasing/update-requirements-reference.py --check --fail-on-outdated ``` With `--check`, the tool fails when a sibling `requirements-reference.txt` is missing, and warns when pins are outdated. The `--fail-on-outdated` option turns outdated pins into errors (used for release PRs to `master`). diff --git a/tools/releasing/requirements-reference.txt b/.dev-tools/releasing/requirements-reference.txt similarity index 100% rename from tools/releasing/requirements-reference.txt rename to .dev-tools/releasing/requirements-reference.txt diff --git a/tools/releasing/requirements.txt b/.dev-tools/releasing/requirements.txt similarity index 100% rename from tools/releasing/requirements.txt rename to .dev-tools/releasing/requirements.txt diff --git a/tools/releasing/update-requirements-reference.py b/.dev-tools/releasing/update-requirements-reference.py similarity index 95% rename from tools/releasing/update-requirements-reference.py rename to .dev-tools/releasing/update-requirements-reference.py index 972a22ae2..5042d78cc 100644 --- a/tools/releasing/update-requirements-reference.py +++ b/.dev-tools/releasing/update-requirements-reference.py @@ -7,11 +7,11 @@ requirements-reference.txt next to each file. Run from the repository root: - python3 tools/releasing/update-requirements-reference.py - python3 tools/releasing/update-requirements-reference.py --all - python3 tools/releasing/update-requirements-reference.py path/to/dir - python3 tools/releasing/update-requirements-reference.py --check - python3 tools/releasing/update-requirements-reference.py --check --fail-on-outdated + python3 .dev-tools/releasing/update-requirements-reference.py + python3 .dev-tools/releasing/update-requirements-reference.py --all + python3 .dev-tools/releasing/update-requirements-reference.py path/to/dir + python3 .dev-tools/releasing/update-requirements-reference.py --check + python3 .dev-tools/releasing/update-requirements-reference.py --check --fail-on-outdated """ from __future__ import annotations @@ -31,7 +31,7 @@ REPO_ROOT = Path(__file__).resolve().parent.parent.parent REFERENCE_NAME = "requirements-reference.txt" -SCRIPT_RELATIVE = "tools/releasing/update-requirements-reference.py" +SCRIPT_RELATIVE = ".dev-tools/releasing/update-requirements-reference.py" # Empty by default: every tracked requirements.txt gets a sibling reference file. EXCLUDED_RELATIVE: set[str] = set() diff --git a/tools/visualize-configs.sh b/.dev-tools/releasing/visualize-configs.sh similarity index 100% rename from tools/visualize-configs.sh rename to .dev-tools/releasing/visualize-configs.sh diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b4187f16e..84e0bd785 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -3,7 +3,7 @@ TODO: Summarize and motivate the changes, link to issues, remove the checklist e ## Checklist - [ ] I added a summary of any user-facing changes (compared to the last release) in the `changelog-entries/.md`. -- [ ] If I changed `requirements.txt` files, I regenerated sibling `requirements-reference.txt` files with `python3 tools/releasing/update-requirements-reference.py` (pass a path to update only that directory, or `--all` to refresh everything). +- [ ] If I changed `requirements.txt` files, I regenerated sibling `requirements-reference.txt` files with `python3 .dev-tools/releasing/update-requirements-reference.py` (pass a path to update only that directory, or `--all` to refresh everything). For new tutorials or tutorial cases: diff --git a/.github/workflows/check-requirements-reference.yml b/.github/workflows/check-requirements-reference.yml index cb3f00f02..c536e0543 100644 --- a/.github/workflows/check-requirements-reference.yml +++ b/.github/workflows/check-requirements-reference.yml @@ -7,8 +7,8 @@ on: paths: - '**/requirements.txt' - '**/requirements-reference.txt' - - tools/releasing/update-requirements-reference.py - - tools/releasing/requirements.txt + - .dev-tools/releasing/update-requirements-reference.py + - .dev-tools/releasing/requirements.txt jobs: check: runs-on: ubuntu-latest @@ -20,10 +20,10 @@ jobs: with: python-version: '3.10' - name: Install packaging - run: pip install -r tools/releasing/requirements.txt + run: pip install -r .dev-tools/releasing/requirements.txt - name: Check requirements-reference.txt files exist if: github.base_ref == 'develop' - run: python3 tools/releasing/update-requirements-reference.py --check + run: python3 .dev-tools/releasing/update-requirements-reference.py --check - name: Check requirements-reference.txt files are up to date if: github.base_ref == 'master' - run: python3 tools/releasing/update-requirements-reference.py --check --fail-on-outdated + run: python3 .dev-tools/releasing/update-requirements-reference.py --check --fail-on-outdated diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07afb69b3..453a6ae08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,22 +31,22 @@ repos: - id: check-image-naming name: check image names language: python - entry: tools/check-image-names.py + entry: .dev-tools/linting/check-image-names.py files: ".*/images/.*" - id: check-size name: check sizes language: script - entry: tools/check-size.sh + entry: .dev-tools/linting/check-size.sh pass_filenames: false - id: check-names name: check file names language: script - entry: tools/check.sh + entry: .dev-tools/linting/check-filenames-permalinks.sh pass_filenames: false - id: check-links-to-precice name: check links to precice.org language: script - entry: tools/check-links-to-precice.sh + entry: .dev-tools/linting/check-links-to-precice.sh types_or: ["markdown", "html"] - repo: https://github.com/rhysd/actionlint rev: v1.7.12 diff --git a/README.md b/README.md index 4c0104e34..3c47f7bbe 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,4 @@ Contributions to this repository are very welcome. Please refer to the page [Con Note that we use [Git LFS](https://git-lfs.com/) to version reference results. These will appear as seemingly empty files containing URLs if you don't have Git LFS installed (optional, mainly useful for our system tests). -For Python dependency ranges and the sibling `requirements-reference.txt` files used for reproducible installs, see [`tools/releasing/README.md`](tools/releasing/README.md). +For Python dependency ranges and the sibling `requirements-reference.txt` files used for reproducible installs, see [`.dev-tools/releasing/README.md`](.dev-tools/releasing/README.md). diff --git a/changelog-entries/610.md b/changelog-entries/610.md index 01b8396c8..b2639e307 100644 --- a/changelog-entries/610.md +++ b/changelog-entries/610.md @@ -1 +1 @@ -- Add loose version constraints to tutorial `requirements.txt` files and sibling `requirements-reference.txt` pins generated from PyPI via `tools/releasing/update-requirements-reference.py`, with a CI check that requires reference files on `develop` and up-to-date pins on release PRs to `master` ([#871](https://github.com/precice/tutorials/pull/871)). +- Add loose version constraints to tutorial `requirements.txt` files and sibling `requirements-reference.txt` pins generated from PyPI via `.dev-tools/releasing/update-requirements-reference.py`, with a CI check that requires reference files on `develop` and up-to-date pins on release PRs to `master` ([#871](https://github.com/precice/tutorials/pull/871)). diff --git a/tools/cleaning-tools.sh b/tools/cleaning-tools.sh old mode 100755 new mode 100644 diff --git a/tools/openfoam-remove-empty-dirs.sh b/tools/openfoam-remove-empty-dirs.sh old mode 100755 new mode 100644