diff --git a/cookiecutter.json b/cookiecutter.json index 8d61f41..3f0da15 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -7,6 +7,7 @@ "project_slug": "{{ (cookiecutter.__project_namespace_slug + '-' if cookiecutter.project_namespace_import else '') + cookiecutter.__module_slug }}", "__project_import": "{{ (cookiecutter.project_namespace_import + '.' if cookiecutter.project_namespace_import else '') + cookiecutter.__module_import }}", "__project_src_path": "src/{{ cookiecutter.__project_import.replace('.', '/') }}", + "__project_src_first": "{{ ('src/' + cookiecutter.project_namespace_import.split('.')[0] if cookiecutter.project_namespace_import else 'src/' + cookiecutter.__module_import) }}", "project_description": "", "repo_type": [ "CLI", diff --git a/{{cookiecutter.project_slug}}/Makefile b/{{cookiecutter.project_slug}}/Makefile index 4f99666..49b2e49 100644 --- a/{{cookiecutter.project_slug}}/Makefile +++ b/{{cookiecutter.project_slug}}/Makefile @@ -53,7 +53,7 @@ run: $(VENV)/pyvenv.cfg $(VENV)/pyvenv.cfg: pyproject.toml uv venv $(VENV) - uv pip install -e '.[$(INSTALL_EXTRA)]' + uv sync --group '$(INSTALL_EXTRA)' .PHONY: lint lint: $(VENV)/pyvenv.cfg diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index b364bd1..684c5c5 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -22,10 +22,20 @@ classifiers = [ dependencies = [] requires-python = ">=3.9" +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.version] +path = "{{ cookiecutter.__project_src_path }}/__init__.py" + +[tool.hatch.build.targets.wheel] +packages = ["{{ cookiecutter.__project_src_first }}"] + [tool.setuptools.dynamic] version = { attr = "{{ cookiecutter.__project_import }}.__version__" } -[project.optional-dependencies] +[dependency-groups] doc = [ {%- if cookiecutter.documentation == "pdoc" -%} "pdoc" @@ -44,7 +54,14 @@ lint = [ "interrogate", {%- endif %} ] -dev = ["{{ cookiecutter.project_slug }}[doc,test,lint]", "twine", "build"] +dev = [ + {include-group = "doc"}, + {include-group = "test"}, + {include-group = "lint"}, + "twine", + "build", + "{{ cookiecutter.project_slug }}", +] {% if cookiecutter.entry_point -%} [project.scripts] @@ -110,3 +127,6 @@ exclude = ["env", "test", "{{ cookiecutter.__project_src_path }}/_cli.py"] ignore-semiprivate = true fail-under = 100 {%- endif %} + +[tool.uv.sources] +{{ cookiecutter.project_slug }} = { workspace = true } \ No newline at end of file