Skip to content

Commit

Permalink
fix: fix the jinja2 template in the config file (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab authored Sep 27, 2024
1 parent e583e70 commit 142b2b7
Show file tree
Hide file tree
Showing 30 changed files with 702 additions and 633 deletions.
10 changes: 5 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.bat]
indent_style = tab
end_of_line = crlf
[*.py]
indent_style = space
indent_size = 4

[LICENSE]
insert_final_newline = false
insert_final_newline = true

[Makefile]
indent_style = tab
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
KXGR_GROUP=group1
SUGAR_GROUP=group1
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
* sugar version:
* Python version:
* Operating System:
- sugar version:
- Python version:
- Operating System:

### Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
Describe what you were trying to get done. Tell us what happened, what went
wrong, and what you expected to happen.

### What I Did

Expand Down
10 changes: 8 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Pull Request description

<!-- Describe the purpose of your PR and the changes you have made. -->

<!-- Which issue this PR aims to resolve or fix? E.g.:
Expand All @@ -16,26 +17,31 @@ Note: for more information check: https://docs.github.com/en/issues/tracking-you
* ...
-->

* ```...```
- `...`

<!-- Modify the options to suit your project. -->

## Pull Request checklists

This PR is a:

- [ ] bug-fix
- [ ] new feature
- [ ] maintenance

About this PR:

- [ ] it includes tests.
- [ ] the tests are executed on CI.
- [ ] the tests generate log file(s) (path).
- [ ] pre-commit hooks were executed locally.
- [ ] this PR requires a project documentation update.

Author's checklist:

- [ ] I have reviewed the changes and it contains no misspelling.
- [ ] The code is well commented, especially in the parts that contain more complexity.
- [ ] The code is well commented, especially in the parts that contain more
complexity.
- [ ] New and old tests passed locally.

## Additional information
Expand Down
96 changes: 48 additions & 48 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: main

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

jobs:
check-branch:
Expand Down Expand Up @@ -39,48 +39,48 @@ jobs:
strategy:
matrix:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

concurrency:
group: ci-tests-${{ matrix.python_version }}-${{ github.ref }}
cancel-in-progress: true

env:
KXGR_PROJECT_NAME: ${{ github.run_id }}-${{ github.sha }}
SUGAR_PROJECT_NAME: ${{ github.run_id }}-${{ github.sha }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: nodefaults,conda-forge
channel-priority: strict
activate-environment: sugar
auto-update-conda: true
conda-solver: libmamba
python-version: "${{ matrix.python_version }}"
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: nodefaults,conda-forge
channel-priority: strict
activate-environment: sugar
auto-update-conda: true
conda-solver: libmamba
python-version: "${{ matrix.python_version }}"

- name: check poetry lock
run: poetry check
- name: check poetry lock
run: poetry check

- name: Install dependencies
run: poetry install --verbose
- name: Install dependencies
run: poetry install --verbose

- name: run unit tests
run: makim --verbose tests.unit
- name: run unit tests
run: makim --verbose tests.unit

- name: CLI tests
run: makim --verbose tests.smoke
- name: CLI tests
run: makim --verbose tests.smoke

- name: Setup tmate session
if: "${{ failure() && (contains(github.event.pull_request.labels.*.name, 'ci:enable-debugging')) }}"
uses: mxschmitt/action-tmate@v3
- name: Setup tmate session
if: "${{ failure() && (contains(github.event.pull_request.labels.*.name, 'ci:enable-debugging')) }}"
uses: mxschmitt/action-tmate@v3

linter:
runs-on: ubuntu-latest
Expand All @@ -95,21 +95,21 @@ jobs:
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: nodefaults,conda-forge
channel-priority: strict
activate-environment: sugar
auto-update-conda: true
conda-solver: libmamba

- name: Install dependencies
run: |
poetry install --verbose
- name: Run style checks
run: makim tests.linter
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: nodefaults,conda-forge
channel-priority: strict
activate-environment: sugar
auto-update-conda: true
conda-solver: libmamba

- name: Install dependencies
run: |
poetry install --verbose
- name: Run style checks
run: makim tests.linter
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Release
on:
workflow_dispatch:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
release:
Expand Down
6 changes: 3 additions & 3 deletions .makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ groups:
dependencies:
- task: docker.killall
run: |
export KXGR_PROJECT_NAME="test-`python -c 'from uuid import uuid4; print(uuid4().hex[:7])'`"
echo $KXGR_PROJECT_NAME
export SUGAR_PROJECT_NAME="test-`python -c 'from uuid import uuid4; print(uuid4().hex[:7])'`"
echo $SUGAR_PROJECT_NAME
sugar build --verbose --group group-defaults
sugar ext start --verbose --group group-defaults --options -d
sugar ext restart --verbose --group group-defaults --options -d
docker ps|grep $KXGR_PROJECT_NAME
docker ps|grep $SUGAR_PROJECT_NAME
sugar ext stop --verbose --group group-defaults
smoke-final:
Expand Down
93 changes: 49 additions & 44 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,58 @@ repos:
hooks:
- id: end-of-file-fixer

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier

- repo: local
hooks:
- id: ruff-format
name: ruff-format
entry: ruff format
exclude: |
(?x)(
docs
)
language: system
pass_filenames: true
types:
- python
- id: ruff-format
name: ruff-format
entry: ruff format
exclude: |
(?x)(
docs
)
language: system
pass_filenames: true
types:
- python

- id: ruff-linter
name: ruff-linter
entry: ruff check --fix
language: system
exclude: "docs/"
pass_filenames: true
types:
- python
- id: ruff-linter
name: ruff-linter
entry: ruff check --fix
language: system
exclude: "docs/"
pass_filenames: true
types:
- python

- id: mypy
name: mypy
entry: mypy
language: system
files: "src/sugar/"
pass_filenames: true
types:
- python
- id: mypy
name: mypy
entry: mypy
language: system
files: "src/sugar/"
pass_filenames: true
types:
- python

- id: bandit
name: bandit
entry: bandit
language: system
args: ['--configfile', 'pyproject.toml']
pass_filenames: true
types:
- python
- id: bandit
name: bandit
entry: bandit
language: system
args: ["--configfile", "pyproject.toml"]
pass_filenames: true
types:
- python

- id: vulture
name: vulture
entry: vulture
language: system
files: "src/sugar/"
description: Find unused Python code.
pass_filenames: true
types:
- python
- id: vulture
name: vulture
entry: vulture
language: system
files: "src/sugar/"
description: Find unused Python code.
pass_filenames: true
types:
- python
10 changes: 5 additions & 5 deletions .sugar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version: 1.0
compose-app: docker-compose
env-file: .env
defaults:
group: {{ env.KXGR_GROUP }}
project-name: sugar-{{ env.KXGR_PROJECT_NAME }}
group: ${{ env.SUGAR_GROUP }}
project-name: sugar-${{ env.SUGAR_PROJECT_NAME }}
groups:
group1:
project-name: project1 # optional
project-name: project1 # optional
compose-path: tests/containers/group1/compose.yaml
env-file: .env
services:
Expand All @@ -17,7 +17,7 @@ groups:
- name: service1-3

group2:
project-name: null # optional
project-name: null # optional
compose-path: tests/containers/group2/compose.yaml
env-file: .env
services:
Expand All @@ -27,7 +27,7 @@ groups:
- name: service2-2

group-mix:
project-name: null # optional
project-name: null # optional
compose-path:
- tests/containers/group1/compose.yaml
- tests/containers/group2/compose.yaml
Expand Down
Loading

0 comments on commit 142b2b7

Please sign in to comment.