Skip to content

Commit

Permalink
Accommodate cookiecutter==2.6.0
Browse files Browse the repository at this point in the history
- The 2.6.0 release of cookiecutter changes the way newlines are handled
  and causing black to fail for rolled out templates.
- To avoid different behavior, the minimum version was bumped to 2.6.0.
  • Loading branch information
rmartin16 committed Feb 21, 2024
1 parent b09da47 commit f03ebd0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -79,7 +79,7 @@ dependencies = [
# cause API breakages). If the package uses calver, we don't pin the upper
# version, as the upper version provides no basis for determining API
# stability.
"cookiecutter >= 2.3.1, < 3.0",
"cookiecutter >= 2.6.0, < 3.0",
"dmgbuild >= 1.6, < 2.0; sys_platform == 'darwin'",
"GitPython >= 3.1, < 4.0",
"platformdirs >= 2.6, < 5.0",
Expand Down
3 changes: 1 addition & 2 deletions src/briefcase/bootstraps/pursuedpybear.py
Expand Up @@ -44,8 +44,7 @@ def main():
ppb.run(
starting_scene={{ cookiecutter.class_name }},
title=metadata["Formal-Name"],
)
"""
)"""

def pyproject_table_briefcase_app_extra_content(self):
return """
Expand Down
3 changes: 1 addition & 2 deletions src/briefcase/bootstraps/pygame.py
Expand Up @@ -54,8 +54,7 @@ def main():
screen.fill(WHITE)
pygame.display.flip()
pygame.quit()
"""
pygame.quit()"""

def pyproject_table_briefcase_app_extra_content(self):
return """
Expand Down
3 changes: 1 addition & 2 deletions src/briefcase/bootstraps/pyside6.py
Expand Up @@ -41,8 +41,7 @@ def main():
app = QtWidgets.QApplication(sys.argv)
main_window = {{ cookiecutter.class_name }}()
sys.exit(app.exec())
"""
sys.exit(app.exec())"""

def pyproject_table_briefcase_app_extra_content(self):
return """
Expand Down
6 changes: 2 additions & 4 deletions src/briefcase/bootstraps/toga.py
Expand Up @@ -25,16 +25,14 @@ def startup(self):
def main():
return {{ cookiecutter.class_name }}()
'''
return {{ cookiecutter.class_name }}()'''

def app_start_source(self):
return """\
from {{ cookiecutter.module_name }}.app import main
if __name__ == "__main__":
main().main_loop()
"""
main().main_loop()"""

def pyproject_table_briefcase_app_extra_content(self):
return """
Expand Down
21 changes: 7 additions & 14 deletions tests/commands/new/test_build_context.py
Expand Up @@ -83,14 +83,12 @@ def startup(self):
def main():
return {{ cookiecutter.class_name }}()
''',
return {{ cookiecutter.class_name }}()''',
app_start_source="""\
from {{ cookiecutter.module_name }}.app import main
if __name__ == "__main__":
main().main_loop()
""",
main().main_loop()""",
pyproject_table_briefcase_app_extra_content="""
requires = [
Expand Down Expand Up @@ -331,8 +329,7 @@ def main():
app = QtWidgets.QApplication(sys.argv)
main_window = {{ cookiecutter.class_name }}()
sys.exit(app.exec())
""",
sys.exit(app.exec())""",
pyproject_table_briefcase_app_extra_content="""
requires = [
Expand Down Expand Up @@ -516,8 +513,7 @@ def main():
ppb.run(
starting_scene={{ cookiecutter.class_name }},
title=metadata["Formal-Name"],
)
""",
)""",
pyproject_table_briefcase_app_extra_content="""
requires = [
Expand Down Expand Up @@ -707,8 +703,7 @@ def main():
screen.fill(WHITE)
pygame.display.flip()
pygame.quit()
""",
pygame.quit()""",
pyproject_table_briefcase_app_extra_content="""
requires = [
Expand Down Expand Up @@ -1074,14 +1069,12 @@ def startup(self):
def main():
return {{ cookiecutter.class_name }}()
''',
return {{ cookiecutter.class_name }}()''',
app_start_source="""\
from {{ cookiecutter.module_name }}.app import main
if __name__ == "__main__":
main().main_loop()
""",
main().main_loop()""",
pyproject_table_briefcase_app_extra_content="""
requires = [
Expand Down

0 comments on commit f03ebd0

Please sign in to comment.