Skip to content

[Merged by Bors] - feat: deprecated module automation - #24917

Closed
adomani wants to merge 86 commits into
masterfrom
adomani/deprecated_module_automation_calling_out_modules
Closed

adomani wants to merge 86 commits into
masterfrom
adomani/deprecated_module_automation_calling_out_modules

Conversation

@adomani

@adomani adomani commented May 14, 2025 •

Copy link
Copy Markdown
Contributor

This PR is a revised version of #24861. It splits the #create_deprecated_modules into two commands:

  • #create_deprecated_module path/to/file.lean that guides you through generating a deprecated file for a file that has been erased (so that the deprecated file will import the same files as the erased one);
  • #create_deprecated_module path/to/old/file.lean rename_to path/to/renamed/file.lean
    that guides you through generating a deprecated file for a file that has been renamed (so that the deprecated file will import just the renamed one);
  • #find_deleted_files n that looks at the repository n commits ago and returns a #create_deprecated_module for each file that existed then and does not exist now.

This is integrated with Try these: suggestions and is intended as a first step in making this process completely automatic.

Each regenerated file consists of either the imports of the deleted file or just imports the renamed file, followed by deprecated_module (since := "YYYY-MM-DD").


Some discussion in #general > deprecated_module @ 💬

Open in Gitpod

@adomani

adomani commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

Can you update the PR description to match the new implementation, please? (You have rename handling now, even if that's not perfect.)

I updated the PR description, thanks!

@adomani

adomani commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

#create_deprecated_module "Mathlib/Analysis/SpecialFunctions/Integrals.lean"

I do not know exactly what the issue is, but the script seems to be using master to figure out whether a file has been renamed or not. I wonder whether using the pair (commit of last modification of a file, commit of file disappearance) would yield a better outcome.

Specifically here I wonder whether origin/master should be replaced by the "adjacent" commit to the other one.

…o adomani/deprecated_module_automation_calling_out_modules
@bryangingechen

Copy link
Copy Markdown
Contributor

Per Zulip discussion, it seems this will be easier to test once merged. Thanks!
bors d+

@mathlib-bors

mathlib-bors Bot commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

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

@ghost ghost added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. labels Sep 1, 2025
@adomani

adomani commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

Thank you all for your comments! I am going to merge, so that testing the behaviour of this command will be easier and we can move closer to fully automate deprecation of modules!

bors r+

@ghost ghost added the ready-to-merge This PR has been sent to bors. label Sep 3, 2025
mathlib-bors Bot pushed a commit that referenced this pull request Sep 3, 2025
This PR is a revised version of #24861.  It splits the `#create_deprecated_modules` into two commands:
* `#create_deprecated_module path/to/file.lean` that guides you through generating a deprecated file for a file that has been *erased* (so that the deprecated file will import the same files as the erased one);
* `#create_deprecated_module path/to/old/file.lean rename_to path/to/renamed/file.lean`
  that guides you through generating a deprecated file for a file that has been *renamed* (so that the deprecated file will import just the renamed one);
* `#find_deleted_files n` that looks at the repository `n` commits ago and returns a `#create_deprecated_module` for each file that existed then and does not exist now.

This is integrated with `Try these:` suggestions and is intended as a first step in making this process completely automatic.

Each regenerated file consists of either the imports of the deleted file or just imports the renamed file, followed by `deprecated_module (since := "YYYY-MM-DD")`.

Co-authored-by: Michael Rothgang <[email protected]>
@mathlib-bors

mathlib-bors Bot commented Sep 3, 2025

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: deprecated module automation [Merged by Bors] - feat: deprecated module automation Sep 3, 2025
@mathlib-bors mathlib-bors Bot closed this Sep 3, 2025
@mathlib-bors
mathlib-bors Bot deleted the adomani/deprecated_module_automation_calling_out_modules branch September 3, 2025 07:21
CBirkbeck pushed a commit to CBirkbeck/mathlib4 that referenced this pull request Sep 8, 2025
This PR is a revised version of leanprover-community#24861.  It splits the `#create_deprecated_modules` into two commands:
* `#create_deprecated_module path/to/file.lean` that guides you through generating a deprecated file for a file that has been *erased* (so that the deprecated file will import the same files as the erased one);
* `#create_deprecated_module path/to/old/file.lean rename_to path/to/renamed/file.lean`
  that guides you through generating a deprecated file for a file that has been *renamed* (so that the deprecated file will import just the renamed one);
* `#find_deleted_files n` that looks at the repository `n` commits ago and returns a `#create_deprecated_module` for each file that existed then and does not exist now.

This is integrated with `Try these:` suggestions and is intended as a first step in making this process completely automatic.

Each regenerated file consists of either the imports of the deleted file or just imports the renamed file, followed by `deprecated_module (since := "YYYY-MM-DD")`.

Co-authored-by: Michael Rothgang <[email protected]>
robertmaxton42 pushed a commit to robertmaxton42/mathlib4 that referenced this pull request Sep 11, 2025
This PR is a revised version of leanprover-community#24861.  It splits the `#create_deprecated_modules` into two commands:
* `#create_deprecated_module path/to/file.lean` that guides you through generating a deprecated file for a file that has been *erased* (so that the deprecated file will import the same files as the erased one);
* `#create_deprecated_module path/to/old/file.lean rename_to path/to/renamed/file.lean`
  that guides you through generating a deprecated file for a file that has been *renamed* (so that the deprecated file will import just the renamed one);
* `#find_deleted_files n` that looks at the repository `n` commits ago and returns a `#create_deprecated_module` for each file that existed then and does not exist now.

This is integrated with `Try these:` suggestions and is intended as a first step in making this process completely automatic.

Each regenerated file consists of either the imports of the deleted file or just imports the renamed file, followed by `deprecated_module (since := "YYYY-MM-DD")`.

Co-authored-by: Michael Rothgang <[email protected]>
joelriou pushed a commit to joelriou/mathlib4 that referenced this pull request Oct 2, 2025
This PR is a revised version of leanprover-community#24861.  It splits the `#create_deprecated_modules` into two commands:
* `#create_deprecated_module path/to/file.lean` that guides you through generating a deprecated file for a file that has been *erased* (so that the deprecated file will import the same files as the erased one);
* `#create_deprecated_module path/to/old/file.lean rename_to path/to/renamed/file.lean`
  that guides you through generating a deprecated file for a file that has been *renamed* (so that the deprecated file will import just the renamed one);
* `#find_deleted_files n` that looks at the repository `n` commits ago and returns a `#create_deprecated_module` for each file that existed then and does not exist now.

This is integrated with `Try these:` suggestions and is intended as a first step in making this process completely automatic.

Each regenerated file consists of either the imports of the deleted file or just imports the renamed file, followed by `deprecated_module (since := "YYYY-MM-DD")`.

Co-authored-by: Michael Rothgang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants