Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 54 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,60 @@
name: Tests

on: [push]

name: CI
on:
push:
branches: ["main"]
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
fail-fast: true
matrix:
python: ["3.7"]
plone: ["52"]
# exclude:
# - python: "3.7"
# plone: "51"
config:
# [Python version, tox env]
- ["3.8", "py38-plone52"]
- ["3.8", "py38-plone60"]
- ["3.9", "py39-plone60"]
- ["3.10", "py310-plone60"]
- ["3.11", "py311-plone60"]
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/buildout-cache
~/extends
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.config[0] }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Fix git
run: git config --global --add safe.directory /github/workspace
- name: Coveralls
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel: true
flag-name: ${{ matrix.config[1] }}

coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache eggs
uses: actions/cache@v1
with:
path: eggs
key: ${{ runner.OS }}-build-python${{ matrix.python }}-${{ matrix.plone }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install -r requirements.txt -c constraints_plone${{ matrix.plone }}.txt
cp test_plone${{ matrix.plone }}.cfg buildout.cfg
- name: Install buildout
run: |
buildout -N -t 3
- name: Run tests
run: |
bin/test
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@v20201129
with:
parallel-finished: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.python-version
.coverage
coverage.json
*.egg-info
*.log
*.mo
Expand Down
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
This text does not appear on pypi or github. It is a comment.

.. image:: https://img.shields.io/pypi/v/redturtle.rssservice.svg
:target: https://pypi.org/project/redturtle.rssservice/
:alt: Latest Version

.. image:: https://img.shields.io/pypi/pyversions/redturtle.rssservice.svg?style=plastic
:target: https://pypi.org/project/redturtle.rssservice/
:alt: Supported - Python Versions

.. image:: https://img.shields.io/pypi/dm/redturtle.rssservice.svg
:target: https://pypi.org/project/redturtle.rssservice/
:alt: Number of PyPI downloads

.. image:: https://img.shields.io/pypi/l/redturtle.rssservice.svg
:target: https://pypi.org/project/redturtle.rssservice/
:alt: License

.. image:: https://github.com/collective/redturtle.rssservice/actions/workflows/tests.yml/badge.svg
:target: https://github.com/collective/redturtle.rssservice/actions
:alt: Tests

.. image:: https://coveralls.io/repos/github/collective/redturtle.rssservice/badge.svg?branch=master
:target: https://coveralls.io/github/collective/redturtle.rssservice?branch=master
:alt: Coverage

=====================
Redturtle RSS Service
=====================
Expand Down
100 changes: 47 additions & 53 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ show-picked-versions = true
extensions =
mr.developer

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

parts =
instance
test
code-analysis
releaser
# we use tox for testing and linting, by default
# code-analysis
coverage
test-coverage
createcoverage
# releaser
i18ndude
omelette
robot
plone-helper-scripts
zpretty
zpretty-run
vscode

develop = .


[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
Expand All @@ -29,36 +32,16 @@ eggs =
Pillow
redturtle.rssservice [test]

zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
allow_origin="http://localhost:3000,http://127.0.0.1:3000"
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT"
allow_credentials="true"
expose_headers="Content-Length,X-My-Header"
allow_headers="Accept,Authorization,Content-Type,X-Custom-Header,Origin"
max_age="3600"
/>
</configure>

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src
flake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,bin,*.egg,setup.py,overrides,omelette
flake8-max-complexity = 25
flake8-ignore = E203, E266, E501, W503, E999
flake8-max-line-length = 200
# flake8-select = B,C,E,F,W,T4,B9
flake8-extensions =
flake8-coding
flake8-debugger
flake8-print
# flake8-isort
# additional pep8/flake8 rules, see docs for details
# https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes
# - E123: closing bracket does not match indentation of opening bracket’s line
# flake8-select = E123
[vscode]
recipe = collective.recipe.vscode
eggs = ${instance:eggs}
autocomplete-use-omelette = True

# [code-analysis]
# recipe = plone.recipe.codeanalysis
# directory = ${buildout:directory}/src/cekk
# return-status-codes = False


[omelette]
recipe = collective.recipe.omelette
Expand All @@ -73,6 +56,30 @@ initialization =
defaults = ['-s', 'redturtle.rssservice', '--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 =
Expand All @@ -89,28 +96,15 @@ eggs = zest.releaser
recipe = zc.recipe.egg
eggs = i18ndude

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

[zpretty-run]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
find src -name '*.zcml' | xargs bin/zpretty -i
output = ${buildout:directory}/bin/zpretty-run
mode = 755

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

[versions]
# Don't use a released version of redturtle.rssservice
Expand Down
3 changes: 3 additions & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
# use this extend one of the buildout configuration:
extends =
test_plone60.cfg

[versions]
setuptools =
2 changes: 0 additions & 2 deletions constraints_plone52.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
-c https://dist.plone.org/release/5.2-latest/requirements.txt
# setuptools==40.2.0
# zc.buildout==2.12.2
16 changes: 16 additions & 0 deletions constraints_plone60.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-c https://dist.plone.org/release/6.0-dev/requirements.txt

#setuptools==54.0.0
#zc.buildout==3.0.0b2
#pip==21.0.1
#
## Windows specific down here (has to be installed here, fails in buildout)
## Dependency of zope.sendmail:
#pywin32 ; platform_system == 'Windows'
#
## SSL Certs on windows, because Python is missing them otherwise:
#certifi ; platform_system == 'Windows'

isort>=5
black==22.8.0
flake8>=5.0.4
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-c constraints_plone52.txt
-c constraints.txt
setuptools
zc.buildout
3 changes: 3 additions & 0 deletions requirements_plone52.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-c constraints_plone52.txt
setuptools
zc.buildout
13 changes: 13 additions & 0 deletions requirements_plone60.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep these the same as in base.cfg please.
pip==22.2.2
setuptools==65.3.0
zc.buildout>=3.0.0rc3
wheel==0.37.1

# Windows specific down here (has to be installed here, fails in buildout)
# Dependency of zope.sendmail:
pywin32 ; platform_system == 'Windows'
# SSL Certs on Windows, because Python is missing them otherwise:
certifi ; platform_system == 'Windows'
# Dependency of collective.recipe.omelette:
ntfsutils ; platform_system == 'Windows' and python_version < '3.0'
23 changes: 3 additions & 20 deletions test_plone52.cfg
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
[buildout]

extends =
https://raw.github.com/collective/buildout.plonetest/master/test-5.2.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.2.x.cfg
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
base.cfg

update-versions-file = test_plone52.cfg

[versions]
plone.testing = 7.0.1

# Added by buildout at 2021-10-09 16:51:16.374919
flake8 = 3.9.2
flake8-coding = 1.3.2
flake8-debugger = 3.2.1
flake8-print = 3.1.4
mccabe = 0.6.1
plone.recipe.codeanalysis = 3.0.1
pyflakes = 2.3.1
requests-mock = 1.7.0
plone.rest = 2.0.0a3

# Required by:
# flake8-debugger==3.2.1
# flake8-print==3.1.4
pycodestyle = 2.7.0

# Added by buildout at 2022-03-22 16:08:55.435429
zpretty = 2.1.0
collective.recipe.vscode = >=0.1.6
importlib-metadata = 1.1.3
Loading