Skip to content

Commit

Permalink
Merge pull request #9 from collective/kitconcept-buildout
Browse files Browse the repository at this point in the history
Use kitconcept buildout
  • Loading branch information
tisto committed Jan 25, 2021
2 parents a09e336 + 1f92113 commit f34c62f
Show file tree
Hide file tree
Showing 11 changed files with 229 additions and 328 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
sudo systemctl status clamav-daemon.service
head /etc/clamav/clamd.conf
- name: pip install
run: pip install -r requirements.txt -c constraints_plone52.txt
run: pip install -r requirements.txt
- name: buildout
run: buildout -t 10 -c test_plone52.cfg
run: buildout -t 10 -c ci.cfg
- name: Run tests
run: bin/test --all
- name: Coverage
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ src/*
test.plone_addon/
var/
.idea/
.vscode/
# files
lib64
log.html
output.xml
pip-selfcheck.json
report.html
pyvenv.cfg
# excludes
!.coveragerc
!.editorconfig
Expand Down
114 changes: 114 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# keep in sync with: https://github.com/kitconcept/buildout/edit/master/Makefile
# update by running 'make update'
SHELL := /bin/bash
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

version = 3

# 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`

all: .installed.cfg

# 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: Update Makefile and Buildout
update: ## Update Make and Buildout
wget -O Makefile https://raw.githubusercontent.com/kitconcept/buildout/master/Makefile
wget -O requirements.txt https://raw.githubusercontent.com/kitconcept/buildout/master/requirements.txt
wget -O plone-4.3.x.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/plone-4.3.x.cfg
wget -O plone-5.1.x.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/plone-5.1.x.cfg
wget -O plone-5.2.x.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/plone-5.2.x.cfg
wget -O ci.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/ci.cfg
wget -O versions.cfg https://raw.githubusercontent.com/kitconcept/buildout/master/versions.cfg

.installed.cfg: bin/buildout *.cfg
bin/buildout

bin/buildout: bin/pip
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/pip install black || true
@touch -c $@

bin/python bin/pip:
python$(version) -m venv . || virtualenv --clear --python=python$(version) .

py2:
virtualenv --clear --python=python2 .
bin/pip install --upgrade pip
bin/pip install -r requirements.txt

.PHONY: Build Plone 4.3
build-plone-4.3: py2 ## Build Plone 4.3
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-4.3.x.cfg

.PHONY: Build Plone 5.0
build-plone-5.0: py2 ## Build Plone 5.0
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-5.0.x.cfg

.PHONY: Build Plone 5.1
build-plone-5.1: py2 ## Build Plone 5.1
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-5.1.x.cfg

.PHONY: Build Plone 5.2
build-plone-5.2: .installed.cfg ## Build Plone 5.2
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-5.2.x.cfg

.PHONY: Build Plone 5.2 Performance
build-plone-5.2-performance: .installed.cfg ## Build Plone 5.2
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-5.2.x-performance.cfg

.PHONY: Test
test: ## Test
bin/test

.PHONY: Test Performance
test-performance:
jmeter -n -t performance.jmx -l jmeter.jtl

.PHONY: Code Analysis
code-analysis: ## Code Analysis
bin/code-analysis
if [ -f "bin/black" ]; then bin/black src/ --check ; fi

.PHONY: Black
black: ## Black
bin/code-analysis
if [ -f "bin/black" ]; then bin/black src/ ; fi

.PHONY: Build Docs
docs: ## Build Docs
bin/sphinxbuilder

.PHONY: Test Release
test-release: ## Run Pyroma and Check Manifest
bin/pyroma -n 10 -d .

.PHONY: Release
release: ## Release
bin/fullrelease

.PHONY: Clean
clean: ## Clean
git clean -Xdf

.PHONY: all clean
66 changes: 15 additions & 51 deletions base.cfg
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
[buildout]
show-picked-versions = true
extensions =
mr.developer

index = https://pypi.python.org/simple/

index = https://pypi.org/simple/
extensions = mr.developer
parts =
instance
test
code-analysis
coverage
test-coverage
createcoverage
releaser
i18ndude
omelette
robot
plone-helper-scripts
develop = .


[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
environment-vars =
zope_i18n_compile_mo_files true
eggs =
Plone
Pillow
collective.clamav [test]


[code-analysis]
recipe = plone.recipe.codeanalysis[recommended]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src/collective
return-status-codes = False
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
flake8-extensions =
flake8-blind-except
flake8-debugger
flake8-coding


[omelette]
Expand All @@ -46,40 +41,14 @@ eggs = ${instance:eggs}
[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
initialization =
os.environ['TZ'] = 'UTC'
defaults = ['-s', 'collective.clamav', '--auto-color', '--auto-progress']


[coverage]
recipe = zc.recipe.egg
eggs = coverage


[test-coverage]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
export TZ=UTC
${buildout:directory}/bin/coverage run bin/test $*
${buildout:directory}/bin/coverage html
${buildout:directory}/bin/coverage report -m --fail-under=90
# Fail (exit status 1) if coverage returns exit status 2 (this happens
# when test coverage is below 100%.
output = ${buildout:directory}/bin/test-coverage
mode = 755


[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage


[robot]
recipe = zc.recipe.egg
eggs =
${test:eggs}
plone.app.robotframework[debug,reload]
plone.app.robotframework


[releaser]
Expand All @@ -91,16 +60,11 @@ eggs = zest.releaser
recipe = zc.recipe.egg
eggs = i18ndude

[plone-helper-scripts]
recipe = zc.recipe.egg
eggs =
Products.CMFPlone
${instance:eggs}
interpreter = zopepy
scripts =
zopepy
plone-compile-resources

[versions]
# Don't use a released version of collective.addons
# Don't use a released version of collective.clamav
collective.clamav =

setuptools =
zc.buildout =
zc.recipe.egg =
Loading

0 comments on commit f34c62f

Please sign in to comment.