Skip to content

Commit

Permalink
Merge 24718d5 into 2653396
Browse files Browse the repository at this point in the history
  • Loading branch information
odelaere committed Jan 20, 2022
2 parents 2653396 + 24718d5 commit 038d7cf
Show file tree
Hide file tree
Showing 23 changed files with 188 additions and 148 deletions.
7 changes: 2 additions & 5 deletions .coveragerc
@@ -1,9 +1,6 @@
[report]
include =
src/collective/*
src/collective/eeafaceted/dashboard/*
omit =
*/test*
src/collective/__init__.py
src/collective/eeafaceted/__init__.py
src/collective/eeafaceted/__init__.py
src/collective/eeafaceted/dashboard/__init__.py
*/__init__.py
89 changes: 89 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,89 @@
# This is a basic workflow to help you get started with Actions

name: CI

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python: 2.7
plone: 4.3
- python: 2.7
plone: 5.1
- python: 2.7
plone: 5.2
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup Env
run: |
pip install -r requirements.txt coverage==5.3.1
- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.plone }}
restore-keys: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.plone }}
- name: buildout
run: |
sed -ie "s#test-4.3#test-${{matrix.plone}}#" buildout.cfg
buildout -c ci.cfg annotate
buildout -c ci.cfg
- name: test
run: |
bin/test -t !robot
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 2.7
uses: actions/setup-python@v2
with:
python-version: 2.7
- name: Setup Env
run: |
pip install -r requirements.txt coverage==5.3.1
- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-coverage-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-coverage-${{ env.cache-name }}
- name: buildout
run: |
buildout -c ci.cfg
- name: code-analysis
run: |
bin/code-analysis
- name: test coverage
run: |
bin/coverage run bin/test -t !robot
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Coveralls
run: |
pip3 install -U pip setuptools --no-cache-dir
pip3 install -U "coveralls>=3.0.0" coverage==5.3.1 --no-cache-dir
- name: Publish to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -8,7 +8,6 @@
*.egg-info
*.EGG-INFO
*.log
.*.cfg
.coverage
bin/
build/
Expand All @@ -25,3 +24,7 @@ var/
src/*
!src/collective
pip-selfcheck.json
.idea
pyvenv.cfg
.installed.cfg
.mr.developer.cfg
6 changes: 6 additions & 0 deletions .isort.cfg
@@ -0,0 +1,6 @@
[settings]
force_alphabetical_sort = True
force_single_line = True
lines_after_imports = 2
line_length = 200
not_skip = __init__.py
62 changes: 0 additions & 62 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion buildout.cfg
@@ -1,4 +1,4 @@
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/plone-4.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/test-4.x.cfg
buildout.d/development.cfg
8 changes: 6 additions & 2 deletions buildout.d/development.cfg
Expand Up @@ -43,6 +43,10 @@ eggs =

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = src/collective
flake8-ignore = E123,E124,E501,E126,E127,E128,W504,W391
pre-commit-hook = True
return-status-codes = True
directory = ${buildout:directory}/src/collective/eeafaceted/dashboard
flake8-ignore = E123,E124,E501,E126,E127,E128,W391,C901,W504
flake8-extensions =
flake8-isort

30 changes: 10 additions & 20 deletions buildout.d/versions.cfg
@@ -1,22 +1,12 @@
[versions]
setuptools=41.2.0
zc.buildout=2.13.2

future =
setuptools = 44.1.1
zc.buildout = 2.13.3
# python 2 ...
traitlets = 4.3.2
future = 0.18.2
# misc
zc.lockfile = 2.0
coverage = 5.3.1
toml = 0.10.2
zope.configuration=3.8.1
z3c.unconfigure=1.1
plone.formwidget.namedfile=2.0.2
pycodestyle=

# python 2 compatibility
soupsieve=1.9.6

# fix to avoid use of wxPython
robotframework-ride = 1.5.2.1

traitlets = 4.3.3

# Required by:
# collective.fingerpointing
zc.lockfile = 1.2.1
file-read-backwards = 1.2.2
plone.formwidget.namedfile = 2.0.6
14 changes: 14 additions & 0 deletions ci.cfg
@@ -0,0 +1,14 @@
[buildout]
extends =
buildout.cfg
eggs-directory = ~/buildout-cache/eggs

parts +=
createcoverage

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

[versions]
coverage = 5.3.1
6 changes: 4 additions & 2 deletions requirements.txt
@@ -1,2 +1,4 @@
setuptools==41.2.0
zc.buildout==2.13.2
pip==20.3.4
setuptools==44.1.1
zc.buildout==2.13.3
wheel
1 change: 1 addition & 0 deletions src/collective/eeafaceted/dashboard/__init__.py
Expand Up @@ -3,4 +3,5 @@

from zope.i18nmessageid import MessageFactory


FacetedDashboardMessageFactory = MessageFactory('collective.eeafaceted.dashboard')
@@ -1,22 +1,21 @@
# encoding: utf-8

from Acquisition import aq_inner, aq_parent

from zope.interface import implements
from plone.portlets.interfaces import IPortletDataProvider
from plone.app.portlets.portlets import base

from Products.CMFPlone.utils import base_hasattr
from Products.CMFPlone.utils import getFSVersionTuple
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from eea.facetednavigation.criteria.interfaces import ICriteria
from eea.facetednavigation.subtypes.interfaces import IFacetedNavigable
from Acquisition import aq_inner
from Acquisition import aq_parent
from collective.eeafaceted.collectionwidget.interfaces import NoFacetedViewDefinedException
from collective.eeafaceted.collectionwidget.utils import getCollectionLinkCriterion
from collective.eeafaceted.collectionwidget.widgets.widget import CollectionWidget

from collective.eeafaceted.dashboard import FacetedDashboardMessageFactory as _
from collective.eeafaceted.dashboard.config import DEFAULT_PORTLET_TITLE
from eea.facetednavigation.criteria.interfaces import ICriteria
from eea.facetednavigation.subtypes.interfaces import IFacetedNavigable
from plone.app.portlets.portlets import base
from plone.portlets.interfaces import IPortletDataProvider
from Products.CMFPlone.utils import base_hasattr
from Products.CMFPlone.utils import getFSVersionTuple
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.interface import implements


# in Plone5, portlet form is a z3c.form, in Plone4 it uses formlib
HAS_PLONE5 = bool(getFSVersionTuple()[0] >= 5)
Expand Down
3 changes: 2 additions & 1 deletion src/collective/eeafaceted/dashboard/browser/overrides.py
Expand Up @@ -4,15 +4,16 @@
from collective.eeafaceted.collectionwidget.interfaces import NotDashboardContextException
from collective.eeafaceted.collectionwidget.utils import getCollectionLinkCriterion
from collective.eeafaceted.collectionwidget.utils import getCurrentCollection
from collective.eeafaceted.dashboard import FacetedDashboardMessageFactory as _
from collective.eeafaceted.dashboard.interfaces import IDashboardGenerablePODTemplates
from collective.eeafaceted.dashboard.utils import getDashboardQueryResult
from collective.eeafaceted.z3ctable.browser.views import FacetedTableView
from collective.eeafaceted.dashboard import FacetedDashboardMessageFactory as _
from eea.facetednavigation.interfaces import IFacetedNavigable
from plone.app.contenttypes.interfaces import ICollection
from plone.memoize.view import memoize
from zope.component import getAdapter


# necessary for now for elements using ICollection from plone.app.collection
HAS_PAC = True
try:
Expand Down
5 changes: 2 additions & 3 deletions src/collective/eeafaceted/dashboard/content/pod_template.py
Expand Up @@ -6,16 +6,15 @@
from collective.eeafaceted.collectionwidget.interfaces import NotDashboardContextException
from collective.eeafaceted.collectionwidget.utils import getCurrentCollection
from collective.eeafaceted.dashboard import FacetedDashboardMessageFactory as _

from plone.autoform import directives as form

from z3c.form.browser.checkbox import CheckBoxFieldWidget
from z3c.form.browser.radio import RadioFieldWidget
from zope import schema
from zope.interface import implements


import logging


logger = logging.getLogger('collective.eeafaceted.dashboard: DashboardPODTemplate')


Expand Down
5 changes: 2 additions & 3 deletions src/collective/eeafaceted/dashboard/testing.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""Base module for unittesting."""

from collective.eeafaceted.dashboard.utils import enableFacetedDashboardFor
from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE
from plone.app.testing import applyProfile
from plone.app.testing import FunctionalTesting
Expand All @@ -16,10 +17,8 @@
from zope.component import getMultiAdapter
from zope.viewlet.interfaces import IViewletManager

import unittest

import collective.eeafaceted.dashboard
from collective.eeafaceted.dashboard.utils import enableFacetedDashboardFor
import unittest


class FacetedDashboardLayer(PloneSandboxLayer):
Expand Down
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
"""Setup/installation tests for this package."""

from plone import api
from collective.eeafaceted.collectionwidget.utils import getCollectionLinkCriterion
from collective.eeafaceted.dashboard.testing import IntegrationTestCase
from collective.eeafaceted.dashboard.utils import enableFacetedDashboardFor
from plone import api
from zope.component import queryUtility
from zope.schema.interfaces import IVocabularyFactory

Expand Down
@@ -1,14 +1,11 @@
# -*- coding: utf-8 -*-

from DateTime import DateTime
from plone import api

from collective.documentgenerator.helper.base import DisplayProxyObject
from collective.documentgenerator.helper.base import DocumentGenerationHelperView

from eea.facetednavigation.interfaces import ICriteria

from collective.eeafaceted.dashboard.testing import IntegrationTestCase
from DateTime import DateTime
from eea.facetednavigation.interfaces import ICriteria
from plone import api


class TestDocumentGeneration(IntegrationTestCase):
Expand Down

0 comments on commit 038d7cf

Please sign in to comment.