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

Re-sync with expl3 for deprecated commands #511

Merged
merged 3 commits into from
May 2, 2024

Conversation

muzimuzhi
Copy link
Contributor

Status

READY

Description

Replace (soft-)deprecated l3kernel \prop_gput_if_new:Nnn with \prop_gput_if_not_in:Nnn, see

  • latex3/latex3@a4f84501 (Rename \prop_(g)put_if_new:Nn to \prop_(g)put_if_not_in:Nn, 2024-03-30) and
  • latex3/latex3@a4390cc9 (Avoid warnings for use of \prop_put_if_new: A temporary change until fontspec is updated., 2024-04-06)

Todos

  • Tests added to cover new/fixed functionality
  • Documentation if necessary
  • Code follows expl3 style guidelines

@muzimuzhi
Copy link
Contributor Author

Ah, that renaming is only part of l3kernel-dev release.

I'll convert this PR to draft for now.

@muzimuzhi muzimuzhi marked this pull request as draft April 29, 2024 18:51
@wspr
Copy link
Collaborator

wspr commented Apr 30, 2024

Thanks again, you are very on the ball :)

This is a silly question, but the test suite should (theoretically) catch commands that lapse into deprecation, right? The header of all the test files contains

\PassOptionsToPackage{check-declarations}{expl3}
\PassOptionsToPackage{enable-debug}{expl3}

\input{regression-test.tex}
\documentclass{article}

\usepackage[enable-debug]{expl3}

(why the awkward construction I do not recall...will fix later)

Or have a missed something?

@muzimuzhi
Copy link
Contributor Author

muzimuzhi commented Apr 30, 2024

  • latex3/latex3@a4f84501 (Rename \prop_(g)put_if_new:Nn to \prop_(g)put_if_not_in:Nn, 2024-03-30) and
  • latex3/latex3@a4390cc9 (Avoid warnings for use of \prop_put_if_new: A temporary change until fontspec is updated., 2024-04-06)

Because the second commit linked above commented out deprecation of \prop_(g)put_if_new:Nnn, also see its full commit message. Thus until l3kernel reverted latex3/latex3@a4390cc9, \prop_(g)put_if_new:Nnn are not being patched by l3debug and won't raise errors with setting \debug_on:n { deprecated }. That's why I used "(soft-)deprecated" instead of simply "deprecated".

Good news is that l3kernel just released 2024-04-11 which contains both commits.

@muzimuzhi muzimuzhi force-pushed the update-deprecated-func branch from 0ca736c to e190b13 Compare April 30, 2024 04:17
@muzimuzhi muzimuzhi marked this pull request as ready for review May 1, 2024 22:51
@muzimuzhi muzimuzhi force-pushed the update-deprecated-func branch from e190b13 to f2b2524 Compare May 1, 2024 22:53
@muzimuzhi
Copy link
Contributor Author

My previous explanation may be confusing.

When this PR was opened, the latest l3kernel release was 2024-03-14 in which \prop_(g)put_if_new:Nnn were not renamed yet.

Now the latest l3kernel release is 2024-04-11 (latex3/latex3@2024-03-14...2024-04-11) which contains two commits:

  • latex3/latex3@a4f84501 which renamed and deprecated \prop_(g)put_if_new:Nnn, and
    \__kernel_patch_deprecation:nnNNpn { 2024-03-30 } { \prop_put_if_not_in:Nnn }
    \cs_new_protected:Npn \prop_put_if_new:Nnn { \prop_put_if_not_in:Nnn }
    \__kernel_patch_deprecation:nnNNpn { 2024-03-30 } { \prop_gput_if_not_in:Nnn }
    \cs_new_protected:Npn \prop_gput_if_new:Nnn { \prop_gput_if_not_in:Nnn }
  • latex3/latex3@a4390cc9 which reverted deprecation of \prop_(g)put_if_new:Nnn (for fontspec) so they are defined as wrappers of corresponding new names and won't raise errors with \debug_on:n { deprecation }.
    %\__kernel_patch_deprecation:nnNNpn { 2024-03-30 } { \prop_put_if_not_in:Nnn }
    \cs_new_protected:Npn \prop_put_if_new:Nnn { \prop_put_if_not_in:Nnn }
    %\__kernel_patch_deprecation:nnNNpn { 2024-03-30 } { \prop_gput_if_not_in:Nnn }
    \cs_new_protected:Npn \prop_gput_if_new:Nnn { \prop_gput_if_not_in:Nnn }

Therefore in both cases the test suite won't catch errors caused by using (now renamed) \prop_(g)put_if_new:Nnn.

@muzimuzhi
Copy link
Contributor Author

BTW, deprecation checking is currently enabled by \debug_on:n { all } in fontspec-testsetup.tex, not check-declarations nor now dropped option enable-debug.

\usepackage[enable-debug]{expl3}
\ExplSyntaxOn
\debug_on:n {all}
\ExplSyntaxOff

muzimuzhi added a commit to muzimuzhi/hello-github-actions that referenced this pull request May 1, 2024
So a PR converted from draft will trigger workflow runs automatically.
See latex3/fontspec#511 for a manually triggered case.
@wspr
Copy link
Collaborator

wspr commented May 2, 2024

@muzimuzhi — sorry if this is a silly question — are you saying that we should delete the following lines from the testsuite setup file:

\PassOptionsToPackage{check-declarations}{expl3}
\PassOptionsToPackage{enable-debug}{expl3}
...
\usepackage[enable-debug]{expl3}

(I can't check this right now at work...) I'd be happy if you'd like to include a tidy up of that file as part of this pull request.

Secondly, based on your comment above I understand that this pull request is now otherwise ready to be merged, correct?

@muzimuzhi
Copy link
Contributor Author

I'd be happy if you'd like to include a tidy up of that file as part of this pull request.

Added.

Secondly, based on your comment above I understand that this pull request is now otherwise ready to be merged, correct?

Yes, this PR is ready to be merged.

@muzimuzhi muzimuzhi force-pushed the update-deprecated-func branch from 7dc1f0a to d9a0a87 Compare May 2, 2024 04:50
@wspr
Copy link
Collaborator

wspr commented May 2, 2024

Thanks much again!

@wspr wspr merged commit 3165d41 into latex3:develop May 2, 2024
3 checks passed
@muzimuzhi muzimuzhi deleted the update-deprecated-func branch May 2, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants