Skip to content

Apply latest Copier template updates#247

Merged
AndrewSazonov merged 13 commits into
developfrom
new-templates
May 12, 2026
Merged

Apply latest Copier template updates#247
AndrewSazonov merged 13 commits into
developfrom
new-templates

Conversation

@AndrewSazonov
Copy link
Copy Markdown
Member

This PR syncs the project with the latest Copier templates. Main changes include replacing deprecated Node.js 20 usage, migrating docstrings from Google style to NumPy style, and applying related template-driven configuration updates.

@AndrewSazonov AndrewSazonov added the [scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH) label May 7, 2026
Copy link
Copy Markdown
Member

@henrikjacobsenfys henrikjacobsenfys left a comment

Choose a reason for hiding this comment

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

I looked at a handful of randomly selected files, and they looked fine.

Copy link
Copy Markdown
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

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

I spent way too much time on this PR :)

Rechecked actions version bump correctness,
Assured client-id is the new version of app-ad in create-github-app-token action
Checked dependency move in pyproject.toml
Got worried about manually copying trstringer/require-label-prefix action
Very useful addition of nodefaults to pixi channels
etc.

One potential issue I have is - do we really, REALLY, need to add the useless docstrings to all the methods?

def __init__(self):
    """Init function."""
def __call__(self, *args, **kwargs):
    """Call function."""

Instead of adding junk, why not just # noqa: DOC comment for those trivial dunder methods?

comments

@damskii9992
Copy link
Copy Markdown
Contributor

Got worried about manually copying trstringer/require-label-prefix action

Yeah, I am not a big fan of that either. But on the other hand, that action is currently not maintained.
Hmm, I remember I saw a PR on the repo which got closed. Looking at the guy who posted the PR, I figured he might have made his own implementation, since trstringer is apparently MIA. And lo an behold, look at what I found:
https://github.com/Rindrics/expect-label-prefix
What do you think @AndrewSazonov ?

@damskii9992
Copy link
Copy Markdown
Contributor

Very useful addition of nodefaults to pixi channels

I believe this was required for us now, right? To make 100% sure we don't accidentally get any commercial conda-packages.

unique_name : Optional[str], default=None
Optional unique name for the list. By default, None.
display_name : Optional[str], default=None
Optional display name for the list. By default, None.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The automatic docstring conversion clearly took some liberties in regards to scanning scanning the code and re-writing the docstrings. We probably need to manually go through the docstrings after this and ammend them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree that a manual check is needed, and that we should all go through the docstrings carefully. But do you suggest doing this as part of the current PR, or plan it as a follow-up task during future development?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Definitely a follow-up task for a future documentation effort :)

Comment thread src/easyscience/legacy/collection_base.py
Comment thread pixi.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml

[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports
ban-relative-imports = 'all'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Didn't we discuss that this was a developer preference? I for one prefer relative imports over absolute imports.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, we did discuss this. Personally, I do not mind whether imports are absolute or relative, but I do care about consistency.

It seems that the only way to guarantee consistency is to enforce absolute imports everywhere. Otherwise, we end up with a random mix of both styles in different places.

Therefore, I prefer absolute imports. That said, if the majority prefers relative imports, I am okay with removing this setting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Or maybe add this as a question at the template generation stage? Default to relative but allow override.
Would that be a solution?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This can of course be added and configured differently for different technique-specific projects. But I think the main question here is which style we want to use in the easyscience module.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added feature request: easyscience/templates#35

@rozyczko
Copy link
Copy Markdown
Member

The one blocking issue is the absolute path fix in test.yml. Once this is sorted out, we should merge this PR ASAP

@AndrewSazonov
Copy link
Copy Markdown
Member Author

One potential issue I have is - do we really, REALLY, need to add the useless docstrings to all the methods?
Instead of adding junk, why not just # noqa: DOC comment for those trivial dunder methods?

Agreed, these placeholder docstrings are not useful.

I also prefer not to add # noqa comments, since that would add a different kind of noise. I checked the current docstring tooling, and it does not require every method to have a docstring: pydoclint validates existing docstrings, and format-docstring formats existing docstrings.

So I removed the useless placeholder docstrings instead. interrogate is still active and reports docstring coverage, so we keep visibility into the current documentation level.

@AndrewSazonov
Copy link
Copy Markdown
Member Author

Got worried about manually copying trstringer/require-label-prefix action

Yeah, I am not a big fan of that either. But on the other hand, that action is currently not maintained. Hmm, I remember I saw a PR on the repo which got closed. Looking at the guy who posted the PR, I figured he might have made his own implementation, since trstringer is apparently MIA. And lo an behold, look at what I found: https://github.com/Rindrics/expect-label-prefix What do you think @AndrewSazonov ?

Thanks for finding that. I switched the templates from the custom script to Rindrics/expect-label-prefix as suggested, and then reapplied the updated templates here.

@AndrewSazonov
Copy link
Copy Markdown
Member Author

The one blocking issue is the absolute path fix in test.yml. Once this is sorted out, we should merge this PR ASAP

This issue is resolved now. Thanks for suggesting the fix.

Copy link
Copy Markdown
Contributor

@damskii9992 damskii9992 left a comment

Choose a reason for hiding this comment

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

Yeah, I think this is ready to be merged now.

@AndrewSazonov AndrewSazonov merged commit 0216322 into develop May 12, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[scope] maintenance Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants