Skip to content

Commit

Permalink
"Create addon: design.plone.policy"
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed May 5, 2020
0 parents commit 35a8d71
Show file tree
Hide file tree
Showing 59 changed files with 1,874 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
include =
src/design/*
omit =
*/test*
*/upgrades/*
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[{*.py,*.cfg}]
indent_size = 4

[{*.html,*.dtml,*.pt,*.zpt,*.xml,*.zcml,*.js}]
indent_size = 2

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGES.rst merge=union
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.coverage
*.egg-info
*.log
*.mo
*.py?
*.swp
# dirs
bin/
buildout-cache/
develop-eggs/
eggs/
htmlcov/
include/
lib/
local/
node_modules/
parts/
src/*
dist/*
test.plone_addon/
var/
# files
.installed.cfg
.mr.developer.cfg
lib64
log.html
output.xml
pip-selfcheck.json
report.html
.vscode/
.tox/
reports/
# excludes
!.coveragerc
!.editorconfig
!.gitattributes
!.gitignore
!.gitkeep
!.travis.yml
!src/design
70 changes: 70 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/plone/tags/
image: python:2.7-stretch

# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"

# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
- downloads/
- eggs/

# Set execution order: first run jobs on 'test' stage on parallel
# then run jobs on 'report' stage
stages:
- test
- report

before_script:
- echo "deb http://ftp.de.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list
- apt-get update
- apt-get install -y firefoxdriver
- apt-get install -y xvfb
- python -V # Print out python version for debugging
- pip install virtualenv
- export LC_CTYPE=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
- virtualenv --clear -p python2.7 venv
- source venv/bin/activate
- pip install -r requirements.txt
- buildout bootstrap
- bin/buildout -n -c buildout.cfg code-analysis:return-status-codes=True

code-analysis:
stage: test
# still not available, see: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5004
# success_with_warnings: True
script:
- bin/code-analysis

robot:
stage: test
script:
- export DISPLAY=:99.0
# - sh -e /etc/init.d/xvfb start
- xvfb-run bin/test --all

coverage:
stage: report
script:
- bin/createcoverage
- bin/coverage html
- bin/coverage report
when: on_success

coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
artifacts:
paths:
- htmlcov
48 changes: 48 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
dist: bionic
language: python
sudo: false
cache:
pip: true
directories:
- eggs
python:
- "2.7"
matrix:
include:
- python: "2.7"
env: PLONE_VERSION=43
- python: "2.7"
env: PLONE_VERSION=51
- python: "2.7"
env: PLONE_VERSION=52
- python: "3.7"
env: PLONE_VERSION=52
sudo: true
fast_finish: true
before_install:
- sudo apt-get install -y firefox-geckodriver
- virtualenv -p `which python` .
- bin/pip install -r requirements.txt -c constraints_plone$PLONE_VERSION.txt
- cp test_plone$PLONE_VERSION.cfg buildout.cfg

install:
- bin/buildout -N -t 3 code-analysis:return-status-codes=True annotate
- bin/buildout -N -t 3 code-analysis:return-status-codes=True

before_script:
- 'export DISPLAY=:99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- sleep 3
- firefox -v

script:
# Run code-analysis, except on Python 3.6, which mysteriously fails to find zc.buildout.
- python --version 2> /dev/stdout | grep 3.6 || bin/code-analysis
- bin/test --all

after_success:
- bin/createcoverage --output-dir=parts/test/coverage
- bin/pip install coverage
- bin/python -m coverage.pickle2json
- bin/pip install -q coveralls
- bin/coveralls
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Changelog
=========


1.0a1 (unreleased)
------------------

- Initial release.
[cekk]
4 changes: 4 additions & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contributors
============

- RedTurtle Technology, [email protected]
42 changes: 42 additions & 0 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Using the development buildout
==============================

Create a virtualenv in the package::

$ virtualenv --clear .

Install requirements with pip::

$ ./bin/pip install -r requirements.txt

Run buildout::

$ ./bin/buildout

Start Plone in foreground:

$ ./bin/instance fg


Running tests
-------------

$ tox

list all tox environments:

$ tox -l
py27-Plone43
py27-Plone51
py27-Plone52
py37-Plone52
build_instance
code-analysis
lint-py27
lint-py37
coverage-report

run a specific tox env:

$ tox -e py37-Plone52

Loading

0 comments on commit 35a8d71

Please sign in to comment.