Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed Oct 7, 2023
1 parent e49ef52 commit 7263c80
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 105 deletions.
166 changes: 80 additions & 86 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
fail-fast: false
matrix:
include:
- python: "2.7"
plone: "4.3"
- python: "3.8"
plone: "5.2"
# - python: "2.7.18"
# plone: "4.3"
# - python: "3.8"
# plone: "5.2"
- python: "3.10"
plone: "6.0"
services:
Expand All @@ -31,11 +31,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v14"
with:
default: "${{ matrix.python }}"
command: pyenv -v
- name: Setup Env
run: |
mkdir -p -m 777 /tmp/appy/
Expand All @@ -44,86 +39,85 @@ jobs:
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
sudo apt-get autoremove -qq -y
sudo apt-get autoclean -qq -y
mkdir -p buildout-cache/{eggs,downloads}
pip install -r requirements-${{ matrix.plone }}.txt
- name: Checkout
uses: actions/checkout@v2
- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
# mkdir -p buildout-cache/{eggs,downloads}
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v16"
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.plone }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.plone }}
default: "${{ matrix.python }}"
command: pip install -U pip
- name: Install dependencies
run: pip install -r requirements-${{ matrix.plone }}.txt
# - name: Cache eggs
# uses: actions/cache@v2
# env:
# cache-name: cache-eggs
# with:
# path: ~/.buildout/eggs
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.plone }}
# restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.plone }}
- name: buildout
run: |
sed -ie "s#plone-5#plone-${{matrix.plone}}#" test-ci.cfg
buildout -c test-ci.cfg annotate
buildout -c test-ci.cfg
- name: code-analysis
run: |
bin/code-analysis
buildout -c test_plone${{ matrix.plone }}.cfg -v
buildout annotate
- name: test
run: |
docker ps -a
cat bin/test
pwd
bin/test --test=\!"robot"
coverage:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- python: "3.10"
plone: "6.0"
services:
libreoffice:
image: imiobe/libreoffice:7.3
ports:
- 2002:2002
volumes:
- /tmp:/tmp
- /var/tmp:/var/tmp
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Env
run: |
mkdir -p -m 777 /tmp/appy/
sudo add-apt-repository ppa:libreoffice/ppa -y
sudo apt update -qq -y
sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
sudo apt-get autoremove -qq -y
sudo apt-get autoclean -qq -y
mkdir -p buildout-cache/{eggs,downloads}
pip install -r requirements-${{ matrix.plone }}.txt
- name: Checkout
uses: actions/checkout@v2
- name: Cache eggs
uses: actions/cache@v2
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ matrix.plone }}
restore-keys: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ matrix.plone }}
- name: buildout
run: |
sed -ie "s#plone-5#plone-${{matrix.plone}}#" test-ci.cfg
pip install -r requirements.txt coverage==5.3.1
buildout -c test-ci.cfg annotate
buildout -c test-ci.cfg
bin/translation-manage -c
- name: test coverage
run: |
bin/coverage run bin/test --test=\!"robot"
- name: Install Coveralls
run: |
pip install -U pip setuptools --no-cache-dir
pip 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
# coverage:
# runs-on: ubuntu-22.04
# strategy:
# fail-fast: false
# matrix:
# include:
# - python: "3.10"
# plone: "6.0"
# services:
# libreoffice:
# image: imiobe/libreoffice:7.3
# ports:
# - 2002:2002
# volumes:
# - /tmp:/tmp
# - /var/tmp:/var/tmp
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Setup Env
# run: |
# mkdir -p -m 777 /tmp/appy/
# sudo add-apt-repository ppa:libreoffice/ppa -y
# sudo apt update -qq -y
# sudo apt-get install -qq -y libreoffice libreoffice-script-provider-python
# sudo apt-get autoremove -qq -y
# sudo apt-get autoclean -qq -y
# mkdir -p buildout-cache/{eggs,downloads}
#
# pip install -r requirements-${{ matrix.plone }}.txt
# - name: Cache eggs
# uses: actions/cache@v2
# env:
# cache-name: cache-eggs
# with:
# path: ~/buildout-cache/eggs
# key: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ matrix.plone }}
# restore-keys: ${{ runner.os }}-coverage-${{ env.cache-name }}-${{ matrix.plone }}
# - name: buildout
# run: |
# cp test_plone${{ matrix.plone }}.cfg buildout.cfg
# pip install -r requirements.txt coverage==5.3.1
# buildout -c ci.cfg annotate
# buildout -c ci.cfg
# bin/translation-manage -c
# - name: test coverage
# run: |
# bin/coverage run bin/test --test=\!"robot"
# - name: Install Coveralls
# run: |
# pip install -U pip setuptools --no-cache-dir
# pip 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
File renamed without changes.
37 changes: 34 additions & 3 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
[buildout]
extends =
buildout.d/plone-6.0.x.cfg
# buildout.d/plone-5.2.x.cfg
# buildout.d/plone-4.3.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/test-6.0.x.cfg
development.cfg

auto-checkout +=
plone.restapi

[sources]
collective.excelexport = git ${remotes:collective}/collective.excelexport.git pushurl=${remotes:collective_push}/collective.excelexport.git branch=plone6
appy = git ${remotes:imio}/appy.git pushurl=${remotes:imio_push}/appy.git branch=python3
plone.restapi = git ${remotes:plone}/plone.restapi.git pushurl=${remotes:plone_push}/plone.restapi.git branch=main
imio.helpers = git ${remotes:imio}/imio.helpers.git pushurl=${remotes:imio_push}/imio.helpers.git branch=plone6

[versions]
appy =
# to keep prompt-toolkit < 3
ipython = 8.3.0

ipdb = 0.13.9
iw.debug = 0.3
jedi = 0.18.1
parso = 0.8.3

# Required by:
# ipdb
asttokens = 2.0.8
backcall = 0.2.0
executing = 1.1.1
matplotlib-inline = 0.1.6
pexpect = 4.8.0
pickleshare = 0.7.5
ptyprocess = 0.7.0
pure-eval = 0.2.2
stack-data = 0.5.1
traitlets = 5.4.0
10 changes: 10 additions & 0 deletions ci.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[buildout]
extends =
buildout.cfg

parts +=
createcoverage

[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage
File renamed without changes.
2 changes: 1 addition & 1 deletion src/collective/documentgenerator/DX_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def render_value(self):
"""Format the date."""
value = self.exportable.render_value(self.context)
plone = getMultiAdapter((self.context, self.request), name=u'plone')
if type(value) == datetime.date:
if isinstance(value, datetime.date):
value = datetime.datetime(value.year, value.month, value.day)
return plone.toLocalizedTime(value)

Expand Down
2 changes: 1 addition & 1 deletion src/collective/documentgenerator/helper/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def display_date(self, field_name=None, date=None, long_format=None, time_only=N
if date is None:
return u''

if type(date) == datetime.date:
if isinstance(date, datetime.date):
date = datetime.datetime(date.year, date.month, date.day)

return ulocalized_time(date, long_format=long_format, time_only=time_only, custom_format=custom_format,
Expand Down
14 changes: 0 additions & 14 deletions test-ci.cfg

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7263c80

Please sign in to comment.