Skip to content
Closed

Uv #28

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
22 changes: 11 additions & 11 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[tool.bumpversion]
allow_dirty = false
commit = false
commit_args = ""
current_version = "0.0.2"
ignore_missing_files = false
ignore_missing_version = false
message = "Bump version: {current_version} → {new_version}"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = false
replace = "{new_version}"
search = "{current_version}"
serialize = ["{major}.{minor}.{patch}"]
sign_tags = false
tag_name = "v{new_version}"
tag = false
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = false
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
tag_name = "v{new_version}"
2 changes: 0 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ indent_style = tab
[default.conf]
indent_style = space
indent_size = 2

{% block extra %}{% endblock extra %}
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
name: CI


on:
workflow_dispatch:
push:
pull_request:

permissions: {}

jobs:
pre-commit:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
# Consider using pre-commit.ci for open source project
python-version: "3.11"

- name: Run pre-commit
uses: pre-commit/[email protected]

ctt:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
version: ['3.11', '3.12', '3.10']
version: ["3.11", "3.12", "3.10"]

steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches: ["main"]
pull_request:
branches: ["**"]

jobs:
zizmor:
name: zizmor latest via PyPI
runs-on: ubuntu-latest
permissions:
security-events: write
# required for workflows in private repositories
contents: read
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5

- name: Run zizmor 🌈
run: uvx zizmor --format sarif . > results.sarif
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
category: zizmor
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand Down Expand Up @@ -29,6 +31,11 @@ repos:
- id: ruff
- id: ruff-format

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.4.1
hooks:
- id: zizmor

# - repo: https://github.com/KyleKing/copier-template-tester
# rev: 2.1.2
# hooks:
Expand Down
79 changes: 40 additions & 39 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template_type:
default: python
choices:
- python
- django
# - django

project_name:
type: str
Expand Down Expand Up @@ -58,41 +58,41 @@ docker:


# Django template
gis:
type: bool
default: false
help: "Setup to use GIS software (GDAL, GEODjango)"
when: "{{ template_type == 'django' }}"

rest:
type: bool
default: false
help: "Need REST APIs"
when: "{{ template_type == 'django' }}"

ldap:
type: bool
default: false
help: "LDAP Authentication"
when: "{{ template_type == 'django' }}"

ui:
type: bool
default: "{{ not rest }}"
help: "Use Django for UI rendering"
when: "{{ template_type == 'django' }}"

queue:
type: bool
default: false
help: "Setup queue system"
when: "{{ template_type == 'django' }}"

primary_color:
type: str
default: "#425563"
when: "{{ ui and template_type == 'django' }}"
help: "Primary color for the theme"
# gis:
# type: bool
# default: false
# help: "Setup to use GIS software (GDAL, GEODjango)"
# when: "{{ template_type == 'django' }}"

# rest:
# type: bool
# default: false
# help: "Need REST APIs"
# when: "{{ template_type == 'django' }}"

# ldap:
# type: bool
# default: false
# help: "LDAP Authentication"
# when: "{{ template_type == 'django' }}"

# ui:
# type: bool
# default: "{{ not rest }}"
# help: "Use Django for UI rendering"
# when: "{{ template_type == 'django' }}"

# queue:
# type: bool
# default: false
# help: "Setup queue system"
# when: "{{ template_type == 'django' }}"

# primary_color:
# type: str
# default: "#425563"
# when: "{{ ui and template_type == 'django' }}"
# help: "Primary color for the theme"

debug:
type: bool
Expand All @@ -102,6 +102,7 @@ debug:

_subdirectory: "{{ template_type }}"

_tasks:
- "python3 -m venv .venv"
- ". .venv/bin/activate && python3 nina-python-init.py {{ default_branch_name }} {{ template_type }} {% if debug %}--debug{% endif%} && rm nina-python-init.py"
_envops:
keep_trailing_newline: true
trim_blocks: true
lstrip_blocks: true
46 changes: 2 additions & 44 deletions ctt.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,10 @@
[defaults]
template_type = "python"
debug = true
template_type = "python"

[output.".ctt/defaults"]
debug = true

[output.".ctt/django-full"]
gis = true
rest = true
template_type = "django"
debug = true
ui = true

[output.".ctt/django-gis"]
gis = true
rest = false
template_type = "django"
ui = false
debug = true

[output.".ctt/django-rest"]
rest = true
template_type = "django"
ui = false
debug = true

[output.".ctt/django-simple"]
gis = false
rest = false
template_type = "django"
ui = false
debug = true

[output.".ctt/django-ui"]
gis = false
rest = false
template_type = "django"
ui = true
debug = true

[output.".ctt/django-queue"]
gis = false
rest = false
template_type = "django"
ui = false
queue = true
debug = true

[output.".ctt/python"]
docker = true
debug = true
docker = true
1 change: 0 additions & 1 deletion django/.dockerignore.jinja

This file was deleted.

1 change: 0 additions & 1 deletion django/.editorconfig.jinja

This file was deleted.

2 changes: 0 additions & 2 deletions django/.env.example

This file was deleted.

2 changes: 0 additions & 2 deletions django/.env.jinja

This file was deleted.

56 changes: 0 additions & 56 deletions django/.github/workflows/ci.yml.jinja

This file was deleted.

Loading
Loading