Skip to content

Commit 069f4d2

Browse files
"Create addon: iosanita.contenttypes"
1 parent fec1c8e commit 069f4d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2058
-0
lines changed

.coveragerc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[report]
2+
include =
3+
src/iosanita/*
4+
omit =
5+
*/test*
6+
*/upgrades/*

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[*]
2+
indent_style = space
3+
end_of_line = lf
4+
insert_final_newline = true
5+
trim_trailing_whitespace = true
6+
charset = utf-8
7+
8+
[{*.py,*.cfg}]
9+
indent_size = 4
10+
11+
[{*.html,*.dtml,*.pt,*.zpt,*.xml,*.zcml,*.js}]
12+
indent_size = 2
13+
14+
[Makefile]
15+
indent_style = tab

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGES.rst merge=union

.github/ISSUE_TEMPLATE.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* iosanita.contenttypes version:
2+
* Plone Version:
3+
* Python version:
4+
* Operating System: Linux
5+
6+
### Description
7+
8+
Describe what you were trying to get done.
9+
Tell us what happened, what went wrong, and what you expected to happen.
10+
11+
### What I Did
12+
13+
```
14+
Paste the command(s) you ran and the output.
15+
If there was a crash, please include the traceback here.
16+
```

.github/workflows/plone-package.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Plone package
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
plone-version:
19+
- 'Plone52'
20+
- 'Plone60'
21+
python-version: [3.7, 3.8, 3.9]
22+
23+
steps:
24+
- uses: actions/setup-python@v4
25+
with:
26+
python-version: '3.9'
27+
- uses: actions/checkout@v3
28+
- uses: actions/cache@v3
29+
with:
30+
path: |
31+
~/.cache/pip
32+
~/buildout-cache
33+
~/extends
34+
key: ${{ runner.os }}-tox-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/*.cfg') }}-${{ hashFiles('**/constraints.txt') }}-${{ hashFiles('**/tox.ini') }}
35+
#restore-keys: |
36+
# ${{ runner.os }}-tox-
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
- name: setup buildout cache
42+
run: |
43+
mkdir -p ~/buildout-cache/{eggs,downloads}
44+
mkdir ~/.buildout
45+
echo "[buildout]" > $HOME/.buildout/default.cfg
46+
echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
47+
echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install tox tox-gh-actions
52+
- name: Black-Check
53+
run: |
54+
tox -r -e black-check
55+
- name: Test with tox
56+
run: |
57+
tox -r
58+
env:
59+
PLONE-VERSION: ${{ matrix.plone-version }}
60+
PYTHON-VERSION: ${{ matrix.python-version }}
61+
- name: "Upload coverage to Codecov"
62+
uses: "codecov/codecov-action@v3"
63+
with:
64+
fail_ci_if_error: true
65+
if: matrix.python-version == '3.7'

.gitignore

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.coverage
2+
.coverage.*
3+
*.egg-info
4+
*.log
5+
*.mo
6+
*.py?
7+
*.swp
8+
.*project
9+
# dirs
10+
/.settings/
11+
bin/
12+
buildout-cache/
13+
develop-eggs/
14+
eggs/
15+
htmlcov/
16+
include/
17+
lib/
18+
local/
19+
node_modules/
20+
parts/
21+
dist/*
22+
test.plone_addon/
23+
var/
24+
# files
25+
.installed.cfg
26+
.mr.developer.cfg
27+
coverage.xml
28+
lib64
29+
local.cfg
30+
log.html
31+
output.xml
32+
pip-selfcheck.json
33+
pyvenv.cfg
34+
report.html
35+
.vscode/
36+
.tox/
37+
reports/
38+
venv/
39+
# excludes

.gitlab-ci.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This file is a template, and might need editing before it works on your project.
2+
# Official language image. Look for the different tagged releases at:
3+
# https://hub.docker.com/r/library/plone/tags/
4+
image: python:3.7-buster
5+
6+
# Change pip's cache directory to be inside the project directory since we can
7+
# only cache local items.
8+
variables:
9+
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
10+
11+
# Pip's cache doesn't store the python packages
12+
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
13+
#
14+
# If you want to also cache the installed packages, you have to install
15+
# them in a virtualenv and cache it as well.
16+
cache:
17+
paths:
18+
- .cache/pip
19+
- venv/
20+
- downloads/
21+
- eggs/
22+
23+
# Set execution order: first run jobs on 'test' stage on parallel
24+
# then run jobs on 'report' stage
25+
stages:
26+
- test
27+
- report
28+
29+
before_script:
30+
- echo "deb http://ftp.de.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list
31+
- apt-get update
32+
- apt-get install -y firefoxdriver
33+
- apt-get install -y xvfb
34+
- python -V # Print out python version for debugging
35+
- pip install virtualenv
36+
- export LC_CTYPE=en_US.UTF-8
37+
- export LC_ALL=en_US.UTF-8
38+
- export LANG=en_US.UTF-8
39+
- python3 -m venv venv
40+
- source venv/bin/activate
41+
- pip install -r requirements.txt
42+
- buildout bootstrap
43+
- bin/buildout -n -c buildout.cfg
44+
45+
code-analysis:
46+
stage: test
47+
# still not available, see: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5004
48+
# success_with_warnings: True
49+
script:
50+
- tox -e black-check
51+
- tox -e py37-lint
52+
53+
test:
54+
stage: test
55+
script:
56+
- export DISPLAY=:99.0
57+
# - sh -e /etc/init.d/xvfb start
58+
- tox -r
59+
60+
coverage:
61+
stage: report
62+
script:
63+
- bin/createcoverage
64+
- bin/coverage html
65+
- bin/coverage report
66+
when: on_success
67+
68+
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
69+
artifacts:
70+
paths:
71+
- htmlcov

.travis.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
dist: bionic
2+
language: python
3+
cache:
4+
pip: true
5+
directories:
6+
- eggs
7+
- $HOME/buildout-cache
8+
- $HOME/.buildout
9+
python:
10+
- "2.7"
11+
matrix:
12+
include:
13+
- python: "2.7"
14+
env: PLONE_VERSION=43
15+
- python: "2.7"
16+
env: PLONE_VERSION=51
17+
- python: "2.7"
18+
env: PLONE_VERSION=52
19+
- python: "3.7"
20+
env: PLONE_VERSION=52
21+
fast_finish: true
22+
23+
before_install:
24+
- mkdir -p $HOME/buildout-cache/{downloads,eggs,extends}
25+
- mkdir -p $HOME/.buildout
26+
- echo "[buildout]" > $HOME/.buildout/default.cfg
27+
- echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
28+
- echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
29+
- echo "extends-cache = $HOME/buildout-cache/extends" >> $HOME/.buildout/default.cfg
30+
- echo "abi-tag-eggs = true" >> $HOME/.buildout/default.cfg
31+
- git config --global user.email "[email protected]"
32+
- git config --global user.name "Travis CI"
33+
- sudo apt-get install -y firefox-geckodriver
34+
- virtualenv -p `which python` .
35+
- bin/pip install -r requirements.txt -c constraints_plone$PLONE_VERSION.txt
36+
- cp test_plone$PLONE_VERSION.cfg buildout.cfg
37+
38+
install:
39+
- travis_retry pip install -U tox coveralls coverage -c constraints.txt
40+
41+
before_script:
42+
- 'export DISPLAY=:99.0'
43+
- export VERBOSE=true
44+
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
45+
- sleep 3
46+
47+
script:
48+
- PYTEST_ADDOPTS="-s -vv" tox
49+
50+
after_success:
51+
- python -m coverage.pickle2json
52+
- coverage combine
53+
- coveralls
54+
55+
notifications:
56+
email:
57+
recipients:
58+
59+
- {author}
60+
on_success: change
61+
on_failure: change

CHANGES.rst

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changelog
2+
=========
3+
4+
5+
1.0a1 (unreleased)
6+
------------------
7+
8+
- Initial release.
9+
[]

CONTRIBUTORS.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Contributors
2+
============
3+
4+
- RedTurtle Technology, [email protected]

DEVELOP.rst

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Using the development buildout
2+
==============================
3+
4+
plonecli
5+
--------
6+
7+
The convenient way, use plonecli build ;)::
8+
9+
$ plonecli build
10+
11+
or with --clear if you want to clean your existing venv::
12+
13+
$ plonecli build --clear
14+
15+
Start your instance::
16+
17+
$ plonecli serve
18+
19+
20+
Without plonecli
21+
----------------
22+
23+
Create a virtualenv in the package::
24+
25+
$ python3 -m venv venv
26+
27+
or with --clear if you want to clean your existing venv::
28+
29+
$ python3 -m venv venv --clear
30+
31+
Install requirements with pip::
32+
33+
$ ./venv/bin/pip install -r requirements.txt
34+
35+
bootstrap your buildout::
36+
37+
$ ./bin/buildout bootstrap
38+
39+
Run buildout::
40+
41+
$ ./bin/buildout
42+
43+
Start Plone in foreground::
44+
45+
$ ./bin/instance fg
46+
47+
48+
Running tests
49+
-------------
50+
51+
$ tox
52+
53+
list all tox environments::
54+
55+
$ tox -l
56+
py27-Plone43
57+
py27-Plone51
58+
py27-Plone52
59+
py37-Plone52
60+
build_instance
61+
code-analysis
62+
lint-py27
63+
lint-py37
64+
coverage-report
65+
66+
run a specific tox env::
67+
68+
$ tox -e py37-Plone52
69+
70+
71+
CI Github-Actions / codecov
72+
---------------------------
73+
74+
The first time you push the repo to github, you might get an error from codecov.
75+
Either you activate the package here: `https://app.codecov.io/gh/collective/+ <https://app.codecov.io/gh/collective/+>`_
76+
Or you just wait a bit, codecov will activate your package automatically.

0 commit comments

Comments
 (0)