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

Fix buggy doc diff script #38468

Merged
merged 4 commits into from
Sep 3, 2024
Merged

Conversation

kwankyu
Copy link
Collaborator

@kwankyu kwankyu commented Aug 4, 2024

Still after #38425, the script generating CHANGES.html needs improvement.

(1) Fixes #38467

test: https://github.com/kwankyu/sage/actions/runs/10257146932/job/28377629063?pr=63
test: https://doc-pr-63--sagemath-test.netlify.app/changes

(2) As seen in https://doc-pr-38339--sagemath.netlify.app/changes (hunk 1), the anchor may be planted in a line very far from where the diff is.

test: https://doc-pr-65--sagemath-test.netlify.app/changes (hunk 1)

(3) As seen in https://github.com/sagemath/sage/actions/runs/10235554395/job/28316513988?pr=38449, the script may fail (and hence doc build github workflow as well) by a bug (I failed to consider that git diff counts lines from 1).

test: https://github.com/kwankyu/sage/actions/runs/10257125674/job/28377566493?pr=64
test: https://doc-pr-64--sagemath-test.netlify.app/changes (warning: slow loading)

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Aug 4, 2024

Documentation preview for this PR (built with commit ed749a4; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu kwankyu changed the title Make doc diff script smarter Fix buggy doc diff script Aug 5, 2024
@kwankyu kwankyu marked this pull request as ready for review August 6, 2024 00:14
Copy link
Contributor

@mkoeppe mkoeppe left a comment

Choose a reason for hiding this comment

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

LGTM

@kwankyu
Copy link
Collaborator Author

kwankyu commented Aug 13, 2024

Thanks!

vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 27, 2024
…er_sphinx`

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

`jupyter_sphinx` is only needed for the live documentation and for some
illustrations in `src/doc/en/tutorial/latex.rst`.

We conditionalize the use of this extension using a Feature.

`configure --disable-notebook` now also disables `jupyter_sphinx`, to
avoid pulling in lots of Jupyter packages via its dependencies
(including `jsonschema`, which has gotten itself a Rust-based
dependency, see sagemath#38219).

This implements the policy for use of platform-dependent wheels proposed
in sagemath#38219 ("if a platform-dependent ``wheel`` package is a standard
package, there must be a ``configure`` option that disables it").

We also repair the mechanism for conditional documentation based on
feature tags.
In particular, the link for Boolean polynomials is restored.
https://doc-pr-38224--
sagemath.netlify.app/html/en/reference/polynomial_rings/#boolean-
polynomials

### 📝 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.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38224
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 27, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Still after sagemath#38425, the script generating CHANGES.html needs
improvement.

(1) Fixes sagemath#38467

test: https://github.com/kwankyu/sage/actions/runs/10257146932/job/28377
629063?pr=63
test:  https://doc-pr-63--sagemath-test.netlify.app/changes

(2) As seen in https://doc-pr-38339--sagemath.netlify.app/changes (hunk
1), the anchor may be planted in a line very far from where the diff is.

test: https://doc-pr-65--sagemath-test.netlify.app/changes  (hunk 1)

(3) As seen in https://github.com/sagemath/sage/actions/runs/10235554395
/job/28316513988?pr=38449, the script may fail (and hence doc build
github workflow as well) by a bug (I failed to consider that git diff
counts lines from 1).

test: https://github.com/kwankyu/sage/actions/runs/10257125674/job/28377
566493?pr=64
test: https://doc-pr-64--sagemath-test.netlify.app/changes (warning:
slow loading)

### 📝 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.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#38468
Reported by: Kwankyu Lee
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 28, 2024
…er_sphinx`

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

`jupyter_sphinx` is only needed for the live documentation and for some
illustrations in `src/doc/en/tutorial/latex.rst`.

We conditionalize the use of this extension using a Feature.

`configure --disable-notebook` now also disables `jupyter_sphinx`, to
avoid pulling in lots of Jupyter packages via its dependencies
(including `jsonschema`, which has gotten itself a Rust-based
dependency, see sagemath#38219).

This implements the policy for use of platform-dependent wheels proposed
in sagemath#38219 ("if a platform-dependent ``wheel`` package is a standard
package, there must be a ``configure`` option that disables it").

We also repair the mechanism for conditional documentation based on
feature tags.
In particular, the link for Boolean polynomials is restored.
https://doc-pr-38224--
sagemath.netlify.app/html/en/reference/polynomial_rings/#boolean-
polynomials

### 📝 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.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38224
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
@vbraun vbraun merged commit 60957ac into sagemath:develop Sep 3, 2024
18 of 21 checks passed
@mkoeppe mkoeppe added this to the sage-10.5 milestone Sep 3, 2024
vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 8, 2024
…cing

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#37760

The css will push the tabs all the way to the right and alter the
vertical spacing so that they are more "in-line".  The vertical spacing
causes some issues as sometimes the text from the previous line will run
into the tabs. To fix this, the previous line now has a `max-width` of
`80%` so that they won't overlap.  This also makes it so that the
`EXAMPLES:` line is on the same line as tabs. (As far as I could tell,
there was no way to distinguish the `EXAMPLES:` text from other text).

A good page to see the changes is on:
`en/reference/rings_standard/sage/rings/integer_ring.html`
as it contains various different formats for sage/python examples.

### 📝 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.
- [ ] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38568
Reported by: Aram Dermenjian
Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 8, 2024
…cing

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#37760

The css will push the tabs all the way to the right and alter the
vertical spacing so that they are more "in-line".  The vertical spacing
causes some issues as sometimes the text from the previous line will run
into the tabs. To fix this, the previous line now has a `max-width` of
`80%` so that they won't overlap.  This also makes it so that the
`EXAMPLES:` line is on the same line as tabs. (As far as I could tell,
there was no way to distinguish the `EXAMPLES:` text from other text).

A good page to see the changes is on:
`en/reference/rings_standard/sage/rings/integer_ring.html`
as it contains various different formats for sage/python examples.

### 📝 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.
- [ ] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38568
Reported by: Aram Dermenjian
Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 10, 2024
…cing

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#37760

The css will push the tabs all the way to the right and alter the
vertical spacing so that they are more "in-line".  The vertical spacing
causes some issues as sometimes the text from the previous line will run
into the tabs. To fix this, the previous line now has a `max-width` of
`80%` so that they won't overlap.  This also makes it so that the
`EXAMPLES:` line is on the same line as tabs. (As far as I could tell,
there was no way to distinguish the `EXAMPLES:` text from other text).

A good page to see the changes is on:
`en/reference/rings_standard/sage/rings/integer_ring.html`
as it contains various different formats for sage/python examples.

### 📝 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.
- [ ] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38568
Reported by: Aram Dermenjian
Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 12, 2024
…cing

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#37760

The css will push the tabs all the way to the right and alter the
vertical spacing so that they are more "in-line".  The vertical spacing
causes some issues as sometimes the text from the previous line will run
into the tabs. To fix this, the previous line now has a `max-width` of
`80%` so that they won't overlap.  This also makes it so that the
`EXAMPLES:` line is on the same line as tabs. (As far as I could tell,
there was no way to distinguish the `EXAMPLES:` text from other text).

A good page to see the changes is on:
`en/reference/rings_standard/sage/rings/integer_ring.html`
as it contains various different formats for sage/python examples.

### 📝 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.
- [ ] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38568
Reported by: Aram Dermenjian
Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 14, 2024
…cing

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Fixes sagemath#37760

The css will push the tabs all the way to the right and alter the
vertical spacing so that they are more "in-line".  The vertical spacing
causes some issues as sometimes the text from the previous line will run
into the tabs. To fix this, the previous line now has a `max-width` of
`80%` so that they won't overlap.  This also makes it so that the
`EXAMPLES:` line is on the same line as tabs. (As far as I could tell,
there was no way to distinguish the `EXAMPLES:` text from other text).

A good page to see the changes is on:
`en/reference/rings_standard/sage/rings/integer_ring.html`
as it contains various different formats for sage/python examples.

### 📝 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.
- [ ] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
- Depends on sagemath#38468 (merged here)
    
URL: sagemath#38568
Reported by: Aram Dermenjian
Reviewer(s): Andrew Mathas, Aram Dermenjian, Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 9, 2024
    
Just some small documentation documentation.

### 📝 Checklist

- [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. (not aware of one)
- [x] I have created tests covering the changes. (no functional change)
- [x] I have updated the documentation and checked the documentation
preview.


--------



Depends on sagemath#38468  to test HTML
documentation generation. (But the dependency is not strict, the
relevant commits can be cherry-picked out.)
    
URL: sagemath#38484
Reported by: user202729
Reviewer(s): Travis Scrimshaw, user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 13, 2024
    
We include TESTS blocks in development documentation, so that they are
visible at least during development.

Then not to ruin CHANGES.html, we refactor doc build github workflow.
The idea is to upload artifact `doc-develop` so that doc diffs are
computed against the doc contained in the artifact.

test: https://doc-develop--sagemath-
test.netlify.app/html/en/reference/structure/sage/structure/sage_object
Look around  for new "TESTS" blocks.

We also remove all spurious diffs caused by EXAMPLES tabs indices
change. Tests for PR event:

doc-develop artifact:
https://github.com/kwankyu/sage/actions/runs/11787561475
doc-build workflow run:
https://github.com/kwankyu/sage/actions/runs/11789320959/job/32837887930

Note that doc build for this PR itself fails here, of course. We may
ignore this.

### 📝 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.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

sagemath#38468
    
URL: sagemath#38449
Reported by: Kwankyu Lee
Reviewer(s): Dima Pasechnik
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 13, 2024
    
Just some small documentation documentation.

### 📝 Checklist

- [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. (not aware of one)
- [x] I have created tests covering the changes. (no functional change)
- [x] I have updated the documentation and checked the documentation
preview.


--------



Depends on sagemath#38468  to test HTML
documentation generation. (But the dependency is not strict, the
relevant commits can be cherry-picked out.)
    
URL: sagemath#38484
Reported by: user202729
Reviewer(s): Travis Scrimshaw, user202729
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 14, 2024
    
We include TESTS blocks in development documentation, so that they are
visible at least during development.

Then not to ruin CHANGES.html, we refactor doc build github workflow.
The idea is to upload artifact `doc-develop` so that doc diffs are
computed against the doc contained in the artifact.

test: https://doc-develop--sagemath-
test.netlify.app/html/en/reference/structure/sage/structure/sage_object
Look around  for new "TESTS" blocks.

We also remove all spurious diffs caused by EXAMPLES tabs indices
change. Tests for PR event:

doc-develop artifact:
https://github.com/kwankyu/sage/actions/runs/11787561475
doc-build workflow run:
https://github.com/kwankyu/sage/actions/runs/11789320959/job/32837887930

Note that doc build for this PR itself fails here, of course. We may
ignore this.

### 📝 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.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

sagemath#38468
    
URL: sagemath#38449
Reported by: Kwankyu Lee
Reviewer(s): Dima Pasechnik
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 14, 2024
    
Just some small documentation documentation.

### 📝 Checklist

- [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. (not aware of one)
- [x] I have created tests covering the changes. (no functional change)
- [x] I have updated the documentation and checked the documentation
preview.


--------



Depends on sagemath#38468  to test HTML
documentation generation. (But the dependency is not strict, the
relevant commits can be cherry-picked out.)
    
URL: sagemath#38484
Reported by: user202729
Reviewer(s): Travis Scrimshaw, user202729
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI docbuild: Possible merge conflict in git stash pop
3 participants