Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
# Initialize git
subprocess.run(["git", "init", "-b", "main"], check=True, shell=use_shell)
subprocess.run(["git", "add", "."], check=True, shell=use_shell)
subprocess.run(["git", "commit", "-m", "Initial commit from cookiecutter"], check=True, shell=use_shell)
subprocess.run(
["git", "commit", "-m", "Initial commit from cookiecutter"],
check=True,
shell=use_shell,
)

# Install dependencies
print("\nInstalling dependencies with Poetry...")
Expand Down
6 changes: 3 additions & 3 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import re
import sys

MODULE_REGEX = r'^[_a-zA-Z][_a-zA-Z0-9]+$'
MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"

module_name = '{{ cookiecutter.project_slug }}'
module_name = "{{ cookiecutter.project_slug }}"

if not re.match(MODULE_REGEX, module_name):
print(f'ERROR: The project slug ({module_name}) is not a valid Python module name.')
print(f"ERROR: The project slug ({module_name}) is not a valid Python module name.")
print('Please do not use a "-" and ensure it starts with a letter or underscore.')
sys.exit(1)
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cookiecutter https://github.com/CoReason-AI/python_template --checkout main
cookiecutter https://github.com/CoReason-AI/python_template --checkout main
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/.github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
{% endraw %}
{% endraw %}
4 changes: 3 additions & 1 deletion {{cookiecutter.project_slug}}/.github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
permissions:
contents: read
packages: write
attestations: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -57,4 +59,4 @@ jobs:
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
{% endraw %}
{% endraw %}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
# No 'user' or 'password' fields are needed here.
# The action automatically uses the OIDC token from the
# 'id-token: write' permission.
{% endraw %}
{% endraw %}