hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Is it possible to customise the project generated via `hatch new`?

Open pfmoore opened this issue 3 years ago • 3 comments

I like being able to start a project with a simple hatch new command. But is it possible to add or alter functionality, for example via a plugin? Maybe the intention is that hatch new should only be for creating a very basic template, and anything more advanced should be handled by a tool like cookiecutter?

There seems to be very basic customisation available via the config file, but that was all I could find.

pfmoore avatar May 22 '22 16:05 pfmoore

👍🏼. I would also like to be able to write a plugin for converting existing repos with hatch new, to automatically translate jupyter_packaging config to equivalent hatch_jupyter_builder config, and other things specific to Jupyter extensions.

blink1073 avatar May 22 '22 16:05 blink1073

Internally project templates are already plugin-based but not the prettiest API so didn't make it in v1.0. I'll think about this next.

ofek avatar May 22 '22 19:05 ofek

I don't have time atm but I now know how the API will look 🙂

ofek avatar Jul 08 '22 01:07 ofek

I would also really like this feature. I find the default pyproject.toml to be waaay overcomplicated. I would prefer a minimal "it just builds the package" to be the default or at least available through --minimal or something.

I often introduce newbies to python at work, and the config-clutter is really unhelpful for teaching/learning about packaging.

The current template makes all kinds of assumptions:

  • Assumes support for earlier python versions in classifiers
  • Assumes I want a licence. I want no licence for packages I create at work. (I am not authorised to write legal stuff on behalf of my employer, and the packages never go on pypi)
  • Assumes I want linters which I generally dont use, but I get huge chunks of config for black, ruff mypy etc
  • Assumes I want pytest, generally I do, but it isnt needed for a --minimal setup
    • Assumes I want 'coverage' set up. Coverage is great, but I would prefer it was opt-in to keep the pyproject.toml minimal

MrNickArcher avatar Sep 29 '23 01:09 MrNickArcher