-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement cookiecutter-plone-starter templates in cookieplone-templates
- Loading branch information
Showing
117 changed files
with
4,972 additions
and
25 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/backend_addon/ @ericof | ||
/frontend_addon/ @sneridagh | ||
/project/ @ericof | ||
/sub/cache/ @ericof | ||
/sub/frontend_project/ @sneridagh | ||
/sub/project_settings/ @sneridagh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: cookieplone-templates CI | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
generation: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
# git checkout | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
# python setup | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
# python install | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
# Test | ||
- name: Run tests | ||
run: | | ||
python -m pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Plone Project CI | ||
on: | ||
push: | ||
paths: | ||
- "project/**" | ||
- ".github/workflows/project.yml" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
generation: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
# git checkout | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
# python setup | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
# python install | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
# Test | ||
- name: Run tests | ||
run: | | ||
cd plone_addon | ||
python -m pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Plone Cache Settings CI | ||
on: | ||
push: | ||
paths: | ||
- "sub/cache_settings/**" | ||
- ".github/workflows/sub_cache_settings.yml" | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
|
||
generation: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
# git checkout | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
# python setup | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
# python install | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
# Test | ||
- name: Run tests | ||
run: | | ||
cd sub/cache_settings | ||
python -m pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Plone Project Settings CI | ||
on: | ||
push: | ||
paths: | ||
- "sub/project_settings/**" | ||
- ".github/workflows/sub_project_settings.yml" | ||
workflow_dispatch: | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
|
||
generation: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
# git checkout | ||
- name: Checkout codebase | ||
uses: actions/checkout@v4 | ||
|
||
# python setup | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
# python install | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
# Test | ||
- name: Run tests | ||
run: | | ||
cd sub/project_settings | ||
python -m pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,13 +65,20 @@ | |
] | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def cookieplone_root() -> dict: | ||
"""Cookieplone root dir.""" | ||
parent = Path().cwd().resolve().parent | ||
return parent | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def variable_pattern(): | ||
return re.compile("{{( ?cookiecutter)[.](.*?)}}") | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def context() -> dict: | ||
def context(cookieplone_root) -> dict: | ||
"""Cookiecutter context.""" | ||
return { | ||
"title": "Addon", | ||
|
@@ -81,6 +88,7 @@ def context() -> dict: | |
"author": "Plone Collective", | ||
"email": "[email protected]", | ||
"feature_headless": "1", | ||
"__cookieplone_repository_path": f"{cookieplone_root}", | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
SHELL := /bin/bash | ||
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
|
||
# We like colors | ||
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects | ||
RED=`tput setaf 1` | ||
GREEN=`tput setaf 2` | ||
RESET=`tput sgr0` | ||
YELLOW=`tput setaf 3` | ||
|
||
.PHONY: all | ||
all: build | ||
|
||
TEMPLATE = $(shell basename $(CURRENT_DIR)) | ||
PROJECT_FOLDER_NAME = project-title | ||
BASE_FOLDER = ../ | ||
BIN_FOLDER = ${BASE_FOLDER}/bin | ||
|
||
|
||
# Add the following 'help' target to your Makefile | ||
# And add help text after each target name starting with '\#\#' | ||
.PHONY: help | ||
help: ## This help message | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: clean | ||
clean: ## Clean | ||
rm -rf volto-addon | ||
|
||
$(BIN_FOLDER)/cookieplone: ## cookieplone installation | ||
$(MAKE) -C $(BASE_FOLDER) bin/cookieplone | ||
|
||
.PHONY: format | ||
format: $(BIN_FOLDER)/cookieplone ## Format code | ||
@echo "$(GREEN)==> Formatting codebase $(RESET)" | ||
$(BIN_FOLDER)/black hooks tests | ||
$(BIN_FOLDER)/isort hooks tests | ||
|
||
.PHONY: generate | ||
generate: $(BIN_FOLDER)/cookieplone ## Create a sample package | ||
@echo "$(GREEN)==> Creating new test package$(RESET)" | ||
rm -rf $(PROJECT_FOLDER_NAME) | ||
COOKIEPLONE_REPOSITORY=$(BASE_FOLDER) $(BIN_FOLDER)/cookieplone $(TEMPLATE) --no_input | ||
|
||
.PHONY: test | ||
test: $(BIN_FOLDER)/cookieplone ## Create a sample package and tests it | ||
@echo "$(GREEN)==> Test template$(RESET)" | ||
$(BIN_FOLDER)/python -m pytest tests | ||
|
||
.PHONY: test-pdb | ||
test-pdb: $(BIN_FOLDER)/cookieplone ## Stop on the first failed test | ||
@echo "$(GREEN)==> Test template, stop on first error$(RESET)" | ||
$(BIN_FOLDER)/python -m pytest tests -x --pdb |
Oops, something went wrong.