Skip to content

Commit

Permalink
Rename additional->extra and collapse requires fields
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Nov 13, 2023
1 parent 4c46f0b commit d838bf4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 66 deletions.
6 changes: 2 additions & 4 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
],
"app_source": "",
"app_start_source": "",
"pyproject_table_briefcase_additional": "",
"pyproject_table_briefcase_app_additional": "",
"pyproject_requires": "",
"pyproject_test_requires": "",
"pyproject_table_briefcase_extra_content": "",
"pyproject_table_briefcase_app_extra_content": "",
"pyproject_table_macOS": "",
"pyproject_table_linux": "",
"pyproject_table_linux_system_debian": "",
Expand Down
68 changes: 15 additions & 53 deletions tests/test_app_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,8 @@ def main():
"tests",
]
requires = [
]
test_requires = [
]
''',
id="minimum context",
id="minimum-context",
),
pytest.param(
{
Expand All @@ -89,12 +84,6 @@ def main():
test_framework="unittest",
app_source=APP_SOURCE,
app_start_source=APP_START_SOURCE,
pyproject_requires="""
"pyproject_requires"
""",
pyproject_test_requires="""
"pyproject_test_requires"
""",
pyproject_table_macOS=SIMPLE_TABLE_CONTENT.format("macOS"),
pyproject_table_linux=SIMPLE_TABLE_CONTENT.format("linux"),
pyproject_table_linux_system_debian=SIMPLE_TABLE_CONTENT.format("deb"),
Expand Down Expand Up @@ -136,13 +125,6 @@ def main():
"tests",
]
requires = [
"pyproject_requires"
]
test_requires = [
"pyproject_test_requires"
]
[tool.briefcase.app.helloworld.macOS]
requires = [
"macOS==1.1.0",
Expand Down Expand Up @@ -206,31 +188,25 @@ def main():
]
''',
id="normal context",
id="normal-context",
),
pytest.param(
{
**BASIC_APP_CONTEXT,
**dict(
app_source=APP_SOURCE,
app_start_source=APP_START_SOURCE,
pyproject_table_briefcase_additional="""
field = "pyproject_table_briefcase_additional"
pyproject_table_briefcase_extra_content="""
field = "pyproject_table_briefcase_extra_content"
answer = 42
""",
pyproject_table_briefcase_app_additional="""
pyproject_table_briefcase_app_extra_content="""
other_resources = [
"dir",
"otherdir",
"pyproject_table_briefcase_app_additional",
"pyproject_table_briefcase_app_extra_content",
]""",
pyproject_requires="""
"pyproject_requires"
""",
pyproject_test_requires="""
"pyproject_test_requires"
""",
pyproject_table_macOS=SIMPLE_TABLE_CONTENT.format("macOS"),
pyproject_table_linux=SIMPLE_TABLE_CONTENT.format("linux"),
pyproject_table_linux_appimage=SIMPLE_TABLE_CONTENT.format("appimage"),
Expand Down Expand Up @@ -265,7 +241,7 @@ def main():
license = "BSD license"
author = "Jane Developer"
author_email = "jane@example.com"
field = "pyproject_table_briefcase_additional"
field = "pyproject_table_briefcase_extra_content"
answer = 42
[tool.briefcase.app.helloworld]
Expand All @@ -281,17 +257,10 @@ def main():
"tests",
]
requires = [
"pyproject_requires"
]
test_requires = [
"pyproject_test_requires"
]
other_resources = [
"dir",
"otherdir",
"pyproject_table_briefcase_app_additional",
"pyproject_table_briefcase_app_extra_content",
]
[tool.briefcase.app.helloworld.macOS]
Expand Down Expand Up @@ -341,17 +310,17 @@ def main():
"value",
]
''',
id="normal context with extra content",
id="normal-context-with-extra-content",
),
pytest.param(
{
**BASIC_APP_CONTEXT,
**dict(
app_source=APP_SOURCE,
app_start_source=APP_START_SOURCE,
pyproject_table_briefcase_additional='\nfield = "pyproject_table_briefcase_additional"',
pyproject_table_briefcase_app_additional="""
other_resources = ["dir", "pyproject_table_briefcase_app_additional"]
pyproject_table_briefcase_extra_content='\nfield = "pyproject_table_briefcase_extra_content"',
pyproject_table_briefcase_app_extra_content="""
other_resources = ["dir", "pyproject_table_briefcase_app_extra_content"]
""",
pyproject_requires="""
"pyproject_requires"
Expand Down Expand Up @@ -381,7 +350,7 @@ def main():
license = "BSD license"
author = "Jane Developer"
author_email = "jane@example.com"
field = "pyproject_table_briefcase_additional"
field = "pyproject_table_briefcase_extra_content"
[tool.briefcase.app.helloworld]
formal_name = "Hello World"
Expand All @@ -395,22 +364,15 @@ def main():
test_sources = [
"tests",
]
requires = [
"pyproject_requires"
]
test_requires = [
"pyproject_test_requires"
]
other_resources = ["dir", "pyproject_table_briefcase_app_additional"]
other_resources = ["dir", "pyproject_table_briefcase_app_extra_content"]
[tool.briefcase.helloworld.my_custom_format_one]
field = "pyproject_extra_content_one"
[tool.briefcase.helloworld.my_custom_format_two]
field = "pyproject_extra_content_two"
''',
id="only extra content",
id="only-extra-content",
),
]

Expand Down
11 changes: 2 additions & 9 deletions {{ cookiecutter.app_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = "{{ cookiecutter.url }}"
license = "{{ cookiecutter.license }}"
author = "{{ cookiecutter.author }}"
author_email = "{{ cookiecutter.author_email }}"
{{- cookiecutter.pyproject_table_briefcase_additional }}
{{- cookiecutter.pyproject_table_briefcase_extra_content }}

[tool.briefcase.app.{{ cookiecutter.app_name|escape_non_ascii }}]
formal_name = "{{ cookiecutter.formal_name|escape_toml }}"
Expand All @@ -21,14 +21,7 @@ sources = [
test_sources = [
"tests",
]

requires = [
{{- cookiecutter.pyproject_requires }}
]
test_requires = [
{{- cookiecutter.pyproject_test_requires }}
]
{{- cookiecutter.pyproject_table_briefcase_app_additional }}
{{- cookiecutter.pyproject_table_briefcase_app_extra_content }}
{% if cookiecutter.pyproject_table_macOS %}

[tool.briefcase.app.{{ cookiecutter.app_name|escape_non_ascii }}.macOS]
Expand Down

0 comments on commit d838bf4

Please sign in to comment.