mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-02-18 04:20:51 +03:00
Update pyproject.toml project information and PEP-735
This commit is contained in:
parent
d12c2e7625
commit
9978e3f35d
|
@ -2,6 +2,7 @@ import glob
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import tomllib
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -412,3 +413,27 @@ def test_trim_domain_email(cookies, context):
|
||||||
|
|
||||||
base_settings = result.project_path / "config" / "settings" / "base.py"
|
base_settings = result.project_path / "config" / "settings" / "base.py"
|
||||||
assert '"me@example.com"' in base_settings.read_text()
|
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"]
|
||||||
|
|
|
@ -141,8 +141,8 @@ extend-unsafe-fixes = [
|
||||||
[tool.ruff.lint.isort]
|
[tool.ruff.lint.isort]
|
||||||
force-single-line = true
|
force-single-line = true
|
||||||
|
|
||||||
[tool.uv]
|
[dependency-groups]
|
||||||
dev-dependencies = [
|
dev = [
|
||||||
"Werkzeug[watchdog]==3.0.6", # https://github.com/pallets/werkzeug
|
"Werkzeug[watchdog]==3.0.6", # https://github.com/pallets/werkzeug
|
||||||
"ipdb==0.13.13", # https://github.com/gotcha/ipdb
|
"ipdb==0.13.13", # https://github.com/gotcha/ipdb
|
||||||
{%- if cookiecutter.use_docker == 'y' %}
|
{%- if cookiecutter.use_docker == 'y' %}
|
||||||
|
@ -182,14 +182,14 @@ dev-dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "cookiecutter-django"
|
name = "{{ cookiecutter.project_slug }}"
|
||||||
version = "2024.10.04"
|
version = "{{ cookiecutter.version }}"
|
||||||
description = "A Cookiecutter template for creating production-ready Django projects quickly."
|
description = "{{ cookiecutter.description }}"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
license = { text = "BSD" }
|
license = { text = "{{ cookiecutter.open_source_license }}" }
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Daniel Roy Greenfeld", email = "pydanny@gmail.com" },
|
{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.email }}" },
|
||||||
]
|
]
|
||||||
requires-python = "==3.12.*"
|
requires-python = "==3.12.*"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user