Skip to content

Move altdoc to config#439

Merged
grantmcdermott merged 2 commits intomainfrom
altdoc_config
Jul 15, 2025
Merged

Move altdoc to config#439
grantmcdermott merged 2 commits intomainfrom
altdoc_config

Conversation

@grantmcdermott
Copy link
Copy Markdown
Owner

@grantmcdermott grantmcdermott commented Jul 9, 2025

Testing the setup suggested by @etiennebacher here: etiennebacher/altdoc#322 (comment)

This is so we can use the dev version of altdoc, but avoid having to comment things out for CRAN submission.

(I'm not sure that it will work given our reliance on Dirk's r-ci script, but let's see what CI throws up.)

@grantmcdermott
Copy link
Copy Markdown
Owner Author

grantmcdermott commented Jul 9, 2025

Hmmm, this somehow seems have removed the altdoc CI workflow completely :-/

Edit: no it's just missing b/c of an invalid structure: https://github.com/grantmcdermott/tinyplot/actions/runs/16172287106

@grantmcdermott
Copy link
Copy Markdown
Owner Author

@eddelbuettel Do you know if there's a way to include a Config/Needs/website: target in DESCRIPTION as part of your r-ci configuration?

For context, this is what I was trying to run (in turn, based on @etiennebacher's equivalent r-lib/actions workflow here). This fails because the "with" statement needs to be paired with a defined "use" action statement rather than a "run" shell script.

- name: Dependencies
run: ./run.sh install_all
with:
needs: website
cache: "always"

@eddelbuettel
Copy link
Copy Markdown

eddelbuettel commented Jul 14, 2025

I am confused. I have no idea what you are trying to do / what gave you the idea this would be supported. r-ci uses a fixed stanza as a minimal default because most normal uses are covered by what is in the DESCRIPTION file. When it is not, e.g. when one needs extras the standard, simple and obvious way is to just add a new stanza covering the need. For example, CRAN and R do not have a way to add a system dependency declaration so when RcppGSL needs libgsl-dev we just install it:

https://github.com/eddelbuettel/rcppgsl/blob/e56acf710866e0b85a36d91eaecc475216d139b0/.github/workflows/ci.yaml#L29-L32

Likewise when RProtoBuf needs a few packages related to Protocol Buffers:

https://github.com/eddelbuettel/rprotobuf/blob/9a5805c60198c57531221a8b3033cc98bf7d2b3d/.github/workflows/ci.yaml#L32-L35

And so on -- there are other examples doing an extra step as needed. You could also wrap that in an action with arguments, and if you think it adds value, have random new fields from DESCRIPTION parsed (not something I do).

At the end of the day a GHA file is just three shellscripts hiding inside a yaml trenchcoat.

Comment thread .github/workflows/altdoc.yaml Outdated
run: ./run.sh install_all
with:
needs: website
cache: "always"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You need the logical equivalent of the declaration of line 55 below added here, potentially in two (OS-dependent) blocks depending on which OS you want to run here. If it is 'merely' an Linux-only documentation build step you do not need to condition and can just list what is needed as arguments to apt, or to install.r (wrapping install.packages()) if you want it to be R. Similarly, installGithub.r fetches from where you think it does etc.

@eddelbuettel
Copy link
Copy Markdown

eddelbuettel commented Jul 14, 2025

So I think this may work:

      - name: Dependencies
        run: |
            # default packages
            ./run.sh install_all
            # altdoc from GH
            ./run.sh install_github etiennebacher/altdoc
            # plus future.apply
            ./run.sh install_r future.apply

[ Untested though. ]

PS Depending on what altdoc itself needs you may want to help it with a preceding dependency installation, but r2u should pick those up as install.packages() is traced via bspm.

@grantmcdermott
Copy link
Copy Markdown
Owner Author

Thanks Dirk, will test after work.

(Also: had a good chuckle at "GHA file is just three shellscripts hiding inside a yaml trenchcoat".)

@eddelbuettel
Copy link
Copy Markdown

The above should work for yoy. It effectively 'hides' the config in the yaml file. You may like or dislike that.

But if you want to configure this in the DESCRIPTION file then you have to way to extract (maybe sed or grep ?) it to the yaml action anyway.

Or ... you could just treat GHA-driven altdoc generation as a perfectly separate step CRAN does not need to know about and cleanly shove it into the yaml file. Keeps concerns separated, and will never affect your CRAN upload.

@grantmcdermott
Copy link
Copy Markdown
Owner Author

Or ... you could just treat GHA-driven altdoc generation as a perfectly separate step CRAN does not need to know about and cleanly shove it into the yaml file. Keeps concerns separated, and will never affect your CRAN upload.

Ya, this is what I'm ultimately aiming for. One less suggests on CRAN and I can remove the (presently annoying) juggle to pull in the dev version.

@eddelbuettel
Copy link
Copy Markdown

Tried to help you our with a test via a quick fork-and-pr (in #443) alas no action was triggered.

@grantmcdermott
Copy link
Copy Markdown
Owner Author

I integrated your changes directly in this PR and... huzzah, that seems to have done it. Thanks @eddelbuettel!

@grantmcdermott grantmcdermott merged commit 2528bc3 into main Jul 15, 2025
3 checks passed
@grantmcdermott
Copy link
Copy Markdown
Owner Author

Ugh, spoke to soon. Failed on main branch now due to GitHub API rate throttling https://github.com/grantmcdermott/tinyplot/actions/runs/16281104006

I'm going to have have ask Etienne or Vincent to make the dev version of this package available on R-universe or easier target.

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