Skip to content

chore: apply Copier template #14

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

Closed
wants to merge 11 commits into from
Closed

chore: apply Copier template #14

wants to merge 11 commits into from

Conversation

34j
Copy link

@34j 34j commented Jun 4, 2025

I think this is good for now. @jorenham @nstarman

@34j 34j marked this pull request as draft June 4, 2025 11:21
@34j 34j marked this pull request as ready for review June 4, 2025 12:11
@34j 34j changed the title feat: apply Copier template chore: apply Copier template Jun 4, 2025
@jorenham jorenham requested review from jorenham and nstarman June 4, 2025 15:28
@34j
Copy link
Author

34j commented Jun 5, 2025

I wonder why CI is not running

@34j
Copy link
Author

34j commented Jun 5, 2025

Unless I can confirm that maintainers agree with most of this PR, I will not be able to open another PR for implementation. Do you have any comments? I suppose @nstarman would have the most opinions about this. When do you think you will be able to review it by? Sorry for the impatience.

In case the setup is a hassle, I can do most of it as long as you authorize me to do it. (I've been denied many times though.)

@nstarman
Copy link
Collaborator

nstarman commented Jun 5, 2025

Review in progress. There are a lot of files.

Copy link
Collaborator

@nstarman nstarman left a comment

Choose a reason for hiding this comment

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

Thanks @34j for the PR! Overall it's good and the forward momentum is appreciated.
A number of comments about tailoring this PR to this repo.

Comment on lines +2 to +3
build-backend = "setuptools.build_meta"
requires = [ "setuptools" ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we'd prefer to keep hatch as the build system.

Repository = "https://github.com/data-apis/array-api-typing"
Changelog = "https://github.com/data-apis/array-api-typing/releases"


[build-system]
Copy link
Collaborator

Choose a reason for hiding this comment

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

The ordering changed. Can you please change it back.

Copy link
Author

Choose a reason for hiding this comment

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

The order was changed by pyproject-fmt on its own. It is not my fault. 😉

Copy link
Collaborator

Choose a reason for hiding this comment

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

SGTM. Then for ease of review, can you separate that into two commits (pre and post application of pre-commit)? I'm just scrolling up scrolling down repeatedly to try and make sure that the settings that were discussed and set up in prior PRs are preserved.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rm.

Copy link
Author

Choose a reason for hiding this comment

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

Same here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rm.

Copy link
Author

@34j 34j Jun 6, 2025

Choose a reason for hiding this comment

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

Same and we need cli for automatic code generation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you elaborate on the code generation?

module = "docs.*"
ignore_errors = true

[tool.semantic_release]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm. I prefer vcs-based version tagging. We had set up hatch-vcs for this reason.
docs/conf.py can read the version out from the toml.

Copy link
Collaborator

Choose a reason for hiding this comment

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

rm. VCS handles this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Rm.

Copy link
Author

Choose a reason for hiding this comment

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

If you delete these temp files, CI will fail and you will not know if this template works correctly.

Copy link
Author

Choose a reason for hiding this comment

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

Of course we are going to replace them in the next PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

A simple __init__.py should suffice

Copy link
Author

Choose a reason for hiding this comment

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

I guess the coverage report would fail

Copy link
Collaborator

Choose a reason for hiding this comment

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

Those files don't exist yet on main and coverage is computed relative to main.

Copy link
Author

@34j 34j Jun 6, 2025

Choose a reason for hiding this comment

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

I don't think that makes sense. Please do not try to waste my time. Or you may commit by yourself.

Copy link
Collaborator

@jorenham jorenham left a comment

Choose a reason for hiding this comment

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

I think we should leave out the docs for now. It's a big project on its own, with an enormous number of degrees of freedom. We should first decide whether we even want docs, and if we do, mkdocs will probably be more in line with all of the other array-api docs (plus I'm biased, because I can't sphinx haha).

@34j
Copy link
Author

34j commented Jun 6, 2025

As a contributor to the Copier template, I am very scared to make any major changes to the template because I'm not sure it will work. And please note that copier upgrade will be more difficult.

I think documentation is primarily needed for the “API Reference”. The template utilized sphinx-apidoc etc. to automatically generate API.

@34j
Copy link
Author

34j commented Jun 6, 2025

@nstarman I have no idea how Hatch works and have never used it, can you compromise with current Semantic-Release? All releases are automatic, so there should be no need to do anything manually. All versions will be replaced and updated automatically by Semantic-release bot.

@nstarman
Copy link
Collaborator

nstarman commented Jun 6, 2025

How does semantic release handle backports? Does it require supporting setup.py and setuptools? What about auto-incrementing per-commit during editable dev installs, which is important for testing CD on TestPyPI?
I'd be open if all those worked seamlessly, like they do with hatch or other setuptools replacements that support VCS.

@34j
Copy link
Author

34j commented Jun 6, 2025

I don't think backports are needed for such a small package.

auto-incrementing per-commit during editable dev installs

I didn't understand this difficult word ...... what does it mean?

At leaset dry-run of Semantic-Release will confirm on PR that most parts of release workflow work fine. That should work on this PR as well... Have you disabled CI?

@34j
Copy link
Author

34j commented Jun 6, 2025

I think I could have handled about half of the change requests. How about a compromise on this? Perhaps both your method and this template's method are wonderful and well automated, just the principle is slightly different

Thanks for your swift review anyway

@34j
Copy link
Author

34j commented Jun 6, 2025

Don't spend time on things that are not essential... So as I said, one-sided censorship is taking place. I don't have infinite time.

@jorenham
Copy link
Collaborator

jorenham commented Jun 6, 2025

Don't spend time on things that are not essential... So as I said, one-sided censorship is taking place. I don't have infinite time.

Why are you saying that?

@34j
Copy link
Author

34j commented Jun 6, 2025

No one is interested in the formatter or build system applied to the project. The types are needed.

@jorenham
Copy link
Collaborator

jorenham commented Jun 6, 2025

No one is interested in the formatter or build system applied to the project.

Development workflow is very important for efficient development. So consider this a necessary investment.


But what did you mean when you said

So as I said, one-sided censorship is taking place. I don't have infinite time.

...?

@34j
Copy link
Author

34j commented Jun 6, 2025

I apologize if I have offended you, but I would like to point out that any further change requests would depend on personal taste rather than being essential, and would destroy all the advantages of the Copier template. Sorry if my English is not good.

@nstarman
Copy link
Collaborator

nstarman commented Jun 6, 2025

Have you disabled CI?

No.

any further change requests would depend on personal taste rather than being essential

This copier template is also entirely based on personal taste. And much of it is not essential.

destroy all the advantages of the Copier template.

I do think that's the crux of the issue. I'm not convinced this template provides all that good a starting point for this type of project. There are a million different copier templates which I've tried and found them useful for different purposes and almost universally only useful as a starting point not to be closely tied to forever. Here, the use of setuptools, ten different config files for systems we aren't using, dunder files including for CLI (why do we need that), etc. So I think the pushback isn't because we are censoring progress, but because we are trying to ensure it's progress and not bloat.

The easiest PR to merge would be a minimal one, which this large template is not. I think it's fair to expect a PR to be reviewed. There's 2 ways to make that process take longer. 1) to be doing something impactful that requires a thoughtful review, and 2) to have a large PR. This PR does both.

Half my comments are about removing unnecessary files. That would certainly make the Pr smaller, but there's still important considerations like how the package is installed and built, which is worthy of discussion.

I appreciate the forward momentum on this project. Let's systematically address the issues through the standard review process and get this merged in. I doubt we will maintain the ability to do copier update, but that's fine because if we build this right, then it will be very easy to maintain.

@nstarman
Copy link
Collaborator

nstarman commented Jun 6, 2025

I didn't understand this difficult word ...... what does it mean?

When the project is installed from a specific commit (eg in editable mode or during CI/CD) the version is unique and greater than the last release. For TestPyPI this is necessary to ensure that TestPyPI recognizes it as a new version.

@34j
Copy link
Author

34j commented Jun 7, 2025

@nstarman Yes, I understand what you are saying, but you are being too particular. I don't care about the details the setup.

If I were in your shoes, I would want to complain massively about my PR, and I agree with you 100%:

  • My reference point is this Copier template. Unlike you (?), my 30+ packages are totally dependent on this template. The more I delete files generated by the template, the more anxious I get.
  • Your reference point is nothing, blank state. You are anxious about the large number of unnecessary settings.

So I think the problem is that the data-apis community is only collegial, you are the maintainer, and you also happen to have not much time to do the setup 🤔, you are still willing to be a "maintainer" (what are you maintaining ?🤔), and the members did not allow to “replace” me as the maintainer. (I seem to be somewhat not included in "we".)
If you were maintaining your own Copier template, you would apply it here and the setup would be instantly done.

Anyway, I'm not an expert in setup and I don't really know what changes you would like to make, so I would like to leave the rest to you 😴. Especially I have never used hatch. Thanks for your swift response.

@34j 34j marked this pull request as draft June 7, 2025 03:51
@34j
Copy link
Author

34j commented Jun 8, 2025

The work was completed at https://github.com/34j/array-api instead. Closing this with a demonstration of the maintainers' willingness not to take over this PR.

@34j 34j closed this Jun 8, 2025
@nstarman
Copy link
Collaborator

nstarman commented Jun 8, 2025

Closing this with a demonstration of the maintainers' willingness not to take over this PR.

Wrong message received.
Very much happy to have automatic code generation and other nice well-thought out features.
Trying to engage in the standard PR review process to not have extraneous and/or outdated configurations.

@nstarman
Copy link
Collaborator

nstarman commented Jun 8, 2025

@34j We'd be very happy to take a PR adding in the very-useful automatic code generation, although your work in https://github.com/34j/array-api/tree/main/src/array_api_compat might be best done as an official array-api-compat-stubs package! Something to consider.

@nstarman nstarman mentioned this pull request Jun 8, 2025
5 tasks
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.

3 participants