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
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
cache: pip
python-version: ${{ matrix.python-version }}
- run: env | sort
- run: pip install copier
- run: copier copy -r HEAD -f . .
- name: Install copier for template rendering
run: python -m pip install --user copier
- name: Generate the project with the default value
run: |
rm -rf src/serious_scaffold
copier copy -x '!src/serious_scaffold' -r HEAD -f . .
- run: git diff
- run: git status --porcelain
- run: |
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Set up Python {{ '${{ matrix.python-version }}' }}
uses: actions/setup-python@v4
with:
cache: pip
python-version: {{ '${{ matrix.python-version }}' }}
- run: env | sort
- run: pip install copier
- run: copier copy -r HEAD -f . .
- name: Install copier for template rendering
run: python -m pip install --user copier
- name: Generate the project with the default value
run: |
rm -rf src/serious_scaffold
copier copy -x '!src/serious_scaffold' -r HEAD -f . .
- run: git diff
- run: git status --porcelain
- run: |
Expand Down
3 changes: 2 additions & 1 deletion src/{{ module_name }}/settings.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ class GlobalSettings(BaseSettings):

class Settings(BaseSettings):
"""Project specific settings."""

{%- if version_lt(minimal_python_version, "3.10") | bool %}

# NOTE(huxuan): Pydantic cannot leverage future annotations at runtime prior to
# Python 3.10, so `from __future__ import annotations` cannot be used here, and the
# lint error need to be ignored unless the minimal Python version >= 3.10.
# Reference: https://github.com/pydantic/pydantic/issues/3300#issuecomment-1034007897
logging_level: Optional[str] = getLevelName(logging.INFO) # noqa: FA100
{%- else %}

logging_level: str | None = getLevelName(logging.INFO)
{%- endif %}
"""Default logging level for the project."""
Expand Down