Skip to content

[Merged by Bors] - feat: warn on deprecated declarations in scripts/check-yaml#38313

Closed
thorimur wants to merge 11 commits intoleanprover-community:masterfrom
thorimur:check-yaml-deprecations
Closed

[Merged by Bors] - feat: warn on deprecated declarations in scripts/check-yaml#38313
thorimur wants to merge 11 commits intoleanprover-community:masterfrom
thorimur:check-yaml-deprecations

Conversation

@thorimur
Copy link
Copy Markdown
Contributor

@thorimur thorimur commented Apr 20, 2026

This PR updates scripts/check-yaml.lean to warn on deprecated declarations.

It also cleans up some code: initSearchPath does exactly what the removed code plus CoreM.withImportModules does (and as far as I can see we no longer need CoreM). Also modulizes and removes the dependence on Mathlib.


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

PR summary 188cb08f82

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

No declarations were harmed in the making of this PR! 🐙

You can run this locally as follows
## summary with just the declaration names:
./scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh contains some details about this script.


No changes to technical debt.

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the CI Modifies the continuous integration setup or other automation label Apr 20, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Apr 20, 2026
Updates deprecated declarations in `1000.yaml`, `overview.yaml`, and `undergrad.yaml`. Found with #38313.

Note: in 1000.yaml, the removed declaration `ProbabilityTheory.binomial_tendsto_poissonPMFReal_atTop` has been deprecated in favor of the adjacent already-present declaration `ProbabilityTheory.tendsto_choose_mul_pow_of_tendsto_mul_atTop`.

Co-authored-by: thorimur <thomasmurrills@gmail.com>
@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 20, 2026
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Apr 20, 2026
@mathlib-dependent-issues
Copy link
Copy Markdown

This PR/issue depends on:

Copy link
Copy Markdown
Contributor

@grunweg grunweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great to have and much cleaner! I'm not an expert on the initSearchPath change (and would appreciate a second pair of eyes on it); the rest is straightforward and much nicer.
maintainer merge?

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by grunweg.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Apr 22, 2026
Comment thread scripts/check-yaml.lean Outdated
Comment thread scripts/check-yaml.lean
Copy link
Copy Markdown
Contributor

@adomani adomani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great!

Would it be possible to add a test for this code? Maybe by extending the databases list to contain a test that exercises the various deprecated/missing possibilities?

Scripts that are not in Mathlib have a tendency of breaking and go unnoticed...

@adomani
Copy link
Copy Markdown
Contributor

adomani commented Apr 22, 2026

Whether or not adding a test is feasible, I'll leave the choice to you!

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Apr 22, 2026

✌️ thorimur can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-triage mathlib-triage Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. labels Apr 22, 2026
@thorimur
Copy link
Copy Markdown
Contributor Author

thorimur commented Apr 23, 2026

Would it be possible to add a test for this code? Maybe by extending the databases list to contain a test that exercises the various deprecated/missing possibilities?

Scripts that are not in Mathlib have a tendency of breaking and go unnoticed...

I'd love to add a test, but it is more than a little awkward...we'd have to adjust the python script to output a new json file, I think (or permanently include a json somewhere?).

It's taking me a little bit to figure out what the right way to test this is, so maybe let's merge this so that no more deprecations creep in in the meantime, then PR the test separately if we can figure it out!

@thorimur
Copy link
Copy Markdown
Contributor Author

bors r+

mathlib-bors Bot pushed a commit that referenced this pull request Apr 23, 2026
This PR updates `scripts/check-yaml.lean` to warn on deprecated declarations.

It also cleans up some code: `initSearchPath` does exactly what the removed code plus `CoreM.withImportModules` does (and as far as I can see we no longer need `CoreM`). Also modulizes and removes the dependence on Mathlib.

Co-authored-by: thorimur <thomasmurrills@gmail.com>
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors Bot commented Apr 23, 2026

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: warn on deprecated declarations in scripts/check-yaml [Merged by Bors] - feat: warn on deprecated declarations in scripts/check-yaml Apr 23, 2026
@mathlib-bors mathlib-bors Bot closed this Apr 23, 2026
@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Apr 23, 2026

Here's an idea about testing: you could

  • add a test-only .json file, referencing a deprecated item
  • check the exact output, and
  • that's it.

I even tend towards "use an actual deprecated item", and adding a detailed comment in the test what it's testing. Every six months, the test will have to be updated to use a new deprecated item. This is not great, but I'd say it's good enough.

Actually, thinking about it more: you could have a test file defining a test-only deprecated item, and use that for the test...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Modifies the continuous integration setup or other automation delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants