Update pyproject.toml project information and PEP-735

This commit is contained in:
Jelmer Draaijer 2024-10-27 11:32:43 +01:00
parent d12c2e7625
commit 9978e3f35d
2 changed files with 32 additions and 7 deletions

View File

@ -2,6 +2,7 @@ import glob
import os
import re
import sys
import tomllib
import pytest
@ -412,3 +413,27 @@ def test_trim_domain_email(cookies, context):
base_settings = result.project_path / "config" / "settings" / "base.py"
assert '"me@example.com"' in base_settings.read_text()
def test_pyproject_toml(cookies, context):
author_name = "Project Author"
author_email = "me@example.com"
context.update(
{
"description": "DESCRIPTION",
"domain_name": "example.com",
"email": author_email,
"author_name": author_name,
}
)
result = cookies.bake(extra_context=context)
assert result.exit_code == 0
pyproject_toml = result.project_path / "pyproject.toml"
data = tomllib.loads(pyproject_toml.read_text())
assert data
assert data["project"]["authors"][0]["email"] == author_email
assert data["project"]["authors"][0]["name"] == author_name
assert data["project"]["name"] == context["project_slug"]

View File

@ -141,8 +141,8 @@ extend-unsafe-fixes = [
[tool.ruff.lint.isort]
force-single-line = true
[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"Werkzeug[watchdog]==3.0.6", # https://github.com/pallets/werkzeug
"ipdb==0.13.13", # https://github.com/gotcha/ipdb
{%- if cookiecutter.use_docker == 'y' %}
@ -182,14 +182,14 @@ dev-dependencies = [
]
[project]
name = "cookiecutter-django"
version = "2024.10.04"
description = "A Cookiecutter template for creating production-ready Django projects quickly."
name = "{{ cookiecutter.project_slug }}"
version = "{{ cookiecutter.version }}"
description = "{{ cookiecutter.description }}"
readme = "README.md"
license = { text = "BSD" }
license = { text = "{{ cookiecutter.open_source_license }}" }
authors = [
{ name = "Daniel Roy Greenfeld", email = "pydanny@gmail.com" },
{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.email }}" },
]
requires-python = "==3.12.*"
dependencies = [