From 8cc70142136a6fe9649f2a2ae82ddc8bf836c46b Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Mon, 17 Jun 2019 14:30:20 +0200 Subject: [PATCH 01/14] Tox improvements and added black as formatter --- plone-5.2.x.cfg | 4 ++++ setup.cfg | 6 ++--- tox.ini | 63 ++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 56 insertions(+), 17 deletions(-) create mode 100644 plone-5.2.x.cfg diff --git a/plone-5.2.x.cfg b/plone-5.2.x.cfg new file mode 100644 index 00000000..7c03ce72 --- /dev/null +++ b/plone-5.2.x.cfg @@ -0,0 +1,4 @@ +[buildout] +extends = + https://raw.github.com/collective/buildout.plonetest/master/test-5.2.x.cfg + base.cfg diff --git a/setup.cfg b/setup.cfg index b2ecb8d6..7cef89a8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,6 +8,7 @@ exclude = bootstrap-buildout.py, ignore = + W503 [isort] force_alphabetical_sort=True @@ -28,15 +29,14 @@ omit = [coverage:report] precision = 2 +include = src omit = *.rst */doctests/* */tests/* [coverage:html] -directory = reports/coverage - - +directory = _build/coverage [bdist_wheel] universal = 1 diff --git a/tox.ini b/tox.ini index 71dbccb3..8f29cf8e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,11 @@ [tox] envlist = py27-plone-{4.3,5.0,5.1}, - isort, - flake8, + py{27,36,37}-plone-{5.2}, + black-check, + lint-py27, + lint-py36, + lint-py37, docs, coverage-report, @@ -13,6 +16,8 @@ skip_install = True basepython: py27: python2.7 + py36: python3.6 + py37: python3.7 extras = test @@ -28,6 +33,7 @@ setenv = plone-4.3: BUILDOUT_FILE="plone-4.3.x.cfg" plone-5.0: BUILDOUT_FILE="plone-5.0.x.cfg" plone-5.1: BUILDOUT_FILE="plone-5.1.x.cfg" + plone-5.2: BUILDOUT_FILE="plone-5.2.x.cfg" deps = pdbpp @@ -54,11 +60,29 @@ commands = coverage html coverage xml -[testenv:flake8] -basepython = python2.7 +[testenv:black-check] +basepython = python3 +skip_install = True +deps = + black + +commands = + black --line-length=79 --check --diff -v --skip-string-normalization src setup.py + +[testenv:black-enforce] +basepython = python3 +skip_install = True +deps = + black + +commands = + black -v --line-length=79 --skip-string-normalization src setup.py + +[lint] skip_install = true deps = + isort flake8 # helper to generate HTML reports: flake8-html @@ -78,22 +102,34 @@ deps = flake8_strict commands = - mkdir -p {toxinidir}/reports/flake8 - - flake8 --ignore=W503 --format=html --htmldir={toxinidir}/reports/flake8 src setup.py - flake8 --ignore=W503 src setup.py + mkdir -p {toxinidir}/_build/flake8 + isort --check-only --recursive {toxinidir}/src setup.py + - flake8 --format=html --htmldir={toxinidir}/_build/flake8 src setup.py + flake8 src setup.py whitelist_externals = mkdir -[testenv:isort] +[testenv:lint-py27] basepython = python2.7 skip_install = true +deps = {[lint]deps} +commands = {[lint]commands} +whitelist_externals = {[lint]whitelist_externals} -deps = - isort +[testenv:lint-py36] +basepython = python3.6 +skip_install = true +deps = {[lint]deps} +commands = {[lint]commands} +whitelist_externals = {[lint]whitelist_externals} -commands = - isort --check-only --recursive {toxinidir}/src +[testenv:lint-py37] +basepython = python3.7 +skip_install = true +deps = {[lint]deps} +commands = {[lint]commands} +whitelist_externals = {[lint]whitelist_externals} [testenv:isort-apply] basepython = python2.7 @@ -103,8 +139,7 @@ deps = isort commands = - isort --apply --recursive {toxinidir}/src - + isort --apply --recursive {toxinidir}/src setup.py [testenv:docs] basepython = python2.7 From 627e0e695b3ee1b4d580d338b3e6c9e10e234321 Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Sat, 30 Jan 2021 20:57:31 +0100 Subject: [PATCH 02/14] test also archetype, split linting --- news/448.feature | 2 + plone-4.3.x-archetypes.cfg | 7 +++ plone-5.0.x-archetypes.cfg | 7 +++ plone-5.1.x-archetypes.cfg | 7 +++ pyproject.toml | 1 + setup.cfg | 1 - src/plone/api/content.py | 2 +- src/plone/api/tests/test_env.py | 2 +- src/plone/api/tests/test_group.py | 1 + tox.ini | 99 +++++++++++++++---------------- 10 files changed, 75 insertions(+), 54 deletions(-) create mode 100644 news/448.feature create mode 100644 plone-4.3.x-archetypes.cfg create mode 100644 plone-5.0.x-archetypes.cfg create mode 100644 plone-5.1.x-archetypes.cfg diff --git a/news/448.feature b/news/448.feature new file mode 100644 index 00000000..66e358dd --- /dev/null +++ b/news/448.feature @@ -0,0 +1,2 @@ +Improve tox.ini so that plone.api could be tested locally. +[loechel] \ No newline at end of file diff --git a/plone-4.3.x-archetypes.cfg b/plone-4.3.x-archetypes.cfg new file mode 100644 index 00000000..b7e43ea4 --- /dev/null +++ b/plone-4.3.x-archetypes.cfg @@ -0,0 +1,7 @@ +[buildout] +extends = + https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg + base.cfg + + +package-extras = [test,archetypes] \ No newline at end of file diff --git a/plone-5.0.x-archetypes.cfg b/plone-5.0.x-archetypes.cfg new file mode 100644 index 00000000..4e37fe1b --- /dev/null +++ b/plone-5.0.x-archetypes.cfg @@ -0,0 +1,7 @@ +[buildout] +extends = + https://raw.github.com/collective/buildout.plonetest/master/test-5.0.x.cfg + base.cfg + + +package-extras = [test,archetypes] \ No newline at end of file diff --git a/plone-5.1.x-archetypes.cfg b/plone-5.1.x-archetypes.cfg new file mode 100644 index 00000000..9b47fb63 --- /dev/null +++ b/plone-5.1.x-archetypes.cfg @@ -0,0 +1,7 @@ +[buildout] +extends = + https://raw.github.com/collective/buildout.plonetest/master/test-5.1.x.cfg + base.cfg + + +package-extras = [test,archetypes] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 05b615de..33a1d197 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,5 @@ [tool.towncrier] +package = "plone.api" filename = "CHANGES.rst" directory = "news/" title_format = "{version} ({project_date})" diff --git a/setup.cfg b/setup.cfg index 7cef89a8..e6a3d564 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,6 @@ force_alphabetical_sort=True force_single_line=True lines_after_imports=2 line_length=200 -not_skip=__init__.py [coverage:run] branch = True diff --git a/src/plone/api/content.py b/src/plone/api/content.py index 99315994..cdae5438 100644 --- a/src/plone/api/content.py +++ b/src/plone/api/content.py @@ -50,7 +50,7 @@ def create( id=None, title=None, safe_id=False, - **kwargs # NOQA: C816 + **kwargs # NOQA: C816, S101 ): """Create a new content item. diff --git a/src/plone/api/tests/test_env.py b/src/plone/api/tests/test_env.py index 49d5cc99..12b0d4bd 100644 --- a/src/plone/api/tests/test_env.py +++ b/src/plone/api/tests/test_env.py @@ -410,8 +410,8 @@ def test_argument_requirement(self): def test_debug_mode(self): """Tests that the retured value is the same as getConfiguration.debug_mode.""" - from plone.api.env import debug_mode from App.config import getConfiguration + from plone.api.env import debug_mode getConfiguration().debug_mode = True self.assertEqual(debug_mode(), True) getConfiguration().debug_mode = False diff --git a/src/plone/api/tests/test_group.py b/src/plone/api/tests/test_group.py index 907973e3..6996068a 100644 --- a/src/plone/api/tests/test_group.py +++ b/src/plone/api/tests/test_group.py @@ -153,6 +153,7 @@ def test_get_groups_nonexistant_user(self): def test_get_groups_anonymous(self): from AccessControl.users import nobody + # In test the anonymous user is aq wrapped in /plone/acl_users # > self.portal.acl_users in api.user.get_current().aq_chain # >>> True diff --git a/tox.ini b/tox.ini index 8f29cf8e..33bee5d7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,28 +1,34 @@ [tox] envlist = py27-plone-{4.3,5.0,5.1}, - py{27,36,37}-plone-{5.2}, - black-check, - lint-py27, - lint-py36, - lint-py37, + py27-plone-{4.3,5.0,5.1}-archetypes, + py{27,36,37,38,39}-plone-{5.2}, docs, +# black-check, + isort, + lint, coverage-report, -skip_missing_interpreters = false +skip_missing_interpreters = False [testenv] skip_install = True +#usedevelop = True +#extras = +# test +# archetypes: archetypes basepython: py27: python2.7 py36: python3.6 py37: python3.7 - -extras = - test + py38: python3.8 + py39: python3.9 + python3 commands = + python -V + pip list mkdir -p {toxinidir}/reports/coverage {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} bootstrap {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} @@ -30,6 +36,9 @@ commands = setenv = COVERAGE_FILE=.coverage.{envname} + plone-4.3-archetypes: BUILDOUT_FILE="plone-4.3.x-archetypes.cfg" + plone-5.0-archetypes: BUILDOUT_FILE="plone-5.0.x-archetypes.cfg" + plone-5.1-archetypes: BUILDOUT_FILE="plone-5.1.x-archetypes.cfg" plone-4.3: BUILDOUT_FILE="plone-4.3.x.cfg" plone-5.0: BUILDOUT_FILE="plone-5.0.x.cfg" plone-5.1: BUILDOUT_FILE="plone-5.1.x.cfg" @@ -45,13 +54,12 @@ whitelist_externals = mkdir [testenv:coverage-report] -basepython = python2.7 deps = coverage setenv = COVERAGE_FILE=.coverage -skip_install = true +skip_install = True commands = coverage erase @@ -61,7 +69,6 @@ commands = coverage xml [testenv:black-check] -basepython = python3 skip_install = True deps = black @@ -70,7 +77,6 @@ commands = black --line-length=79 --check --diff -v --skip-string-normalization src setup.py [testenv:black-enforce] -basepython = python3 skip_install = True deps = black @@ -78,8 +84,25 @@ deps = commands = black -v --line-length=79 --skip-string-normalization src setup.py -[lint] -skip_install = true +[testenv:isort-apply] +skip_install = True + +deps = + isort + +commands = + isort {toxinidir}/src setup.py {posargs} + +[testenv:isort] +skip_install = True +deps = + isort + +commands = + isort --check-only --diff {toxinidir}/src setup.py + +[testenv:lint] +skip_install = True deps = isort @@ -103,52 +126,26 @@ deps = commands = mkdir -p {toxinidir}/_build/flake8 - isort --check-only --recursive {toxinidir}/src setup.py - flake8 --format=html --htmldir={toxinidir}/_build/flake8 src setup.py flake8 src setup.py whitelist_externals = mkdir -[testenv:lint-py27] -basepython = python2.7 -skip_install = true -deps = {[lint]deps} -commands = {[lint]commands} -whitelist_externals = {[lint]whitelist_externals} - -[testenv:lint-py36] -basepython = python3.6 -skip_install = true -deps = {[lint]deps} -commands = {[lint]commands} -whitelist_externals = {[lint]whitelist_externals} - -[testenv:lint-py37] -basepython = python3.7 -skip_install = true -deps = {[lint]deps} -commands = {[lint]commands} -whitelist_externals = {[lint]whitelist_externals} - -[testenv:isort-apply] -basepython = python2.7 -skip_install = true - +[testenv:docs] +skip_install = True deps = - isort + Sphinx commands = - isort --apply --recursive {toxinidir}/src setup.py + sphinx-build -b html -d _build/docs/doctrees docs _build/docs/html +# sphinx-build -b doctest docs _build/docs/doctrees -[testenv:docs] -basepython = python2.7 -skip_install = false +[testenv:towncrier] +skip_install = True -deps = - Sphinx - AccessControl +deps= + towncrier commands = - sphinx-build -b html -d _build/docs/doctrees docs _build/docs/html - sphinx-build -b doctest docs _build/docs/doctrees + towncrier --draft \ No newline at end of file From 90095147f2f7e8448759c121efcf86bf277f43ad Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Sat, 30 Jan 2021 21:42:39 +0100 Subject: [PATCH 03/14] more fixes on tox.ini, added a .editorconf --- .editorconfig | 42 ++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 ++ tox.ini | 30 ++++++++++++++++++++++++++---- 3 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c85c9bc4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,42 @@ +# EditorConfig Configurtaion file, for more details see: +# http://EditorConfig.org +# EditorConfig is a convention description, that could be interpreted +# by multiple editors to enforce common coding conventions for specific +# file types + +# top-most EditorConfig file: +# Will ignore other EditorConfig files in Home directory or upper tree level. +root = true + +[*] # For All Files +# Unix-style newlines with a newline ending every file +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +# Set default charset +charset = utf-8 +# Indent style default +indent_style = space +# Max Line Length - a hard line wrap, should be disabled +max_line_length = off + +[*.{py,cfg,ini}] +# 4 space indentation +indent_size = 4 + +[*.{yml}] +# 2 space indentation +indent_size = 2 + +[{Makefile,.gitmodules}] +# Tab indentation (no size specified, but view as 4 spaces) +indent_style = tab +indent_size = unset +tab_width = unset + +[*.bat] +indent_style = tab +end_of_line = crlf + +[LICENSE] +insert_final_newline = false diff --git a/setup.py b/setup.py index fa076d35..f2ff9023 100644 --- a/setup.py +++ b/setup.py @@ -69,6 +69,8 @@ def read(*rnames): 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], platforms='Any', ) diff --git a/tox.ini b/tox.ini index 33bee5d7..0de2287e 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,6 @@ basepython: py37: python3.7 py38: python3.8 py39: python3.9 - python3 commands = python -V @@ -54,6 +53,7 @@ whitelist_externals = mkdir [testenv:coverage-report] +basepython = python deps = coverage setenv = @@ -62,6 +62,7 @@ setenv = skip_install = True commands = + python -V coverage erase coverage combine coverage report @@ -69,39 +70,48 @@ commands = coverage xml [testenv:black-check] +basepython = python skip_install = True deps = black commands = + python -V black --line-length=79 --check --diff -v --skip-string-normalization src setup.py [testenv:black-enforce] +basepython = python skip_install = True deps = black commands = + python -V black -v --line-length=79 --skip-string-normalization src setup.py [testenv:isort-apply] +basepython = python skip_install = True deps = isort commands = + python -V isort {toxinidir}/src setup.py {posargs} [testenv:isort] +basepython = python skip_install = True -deps = +deps = isort commands = + python -V isort --check-only --diff {toxinidir}/src setup.py [testenv:lint] +basepython = python skip_install = True deps = @@ -125,6 +135,7 @@ deps = flake8_strict commands = + python -V mkdir -p {toxinidir}/_build/flake8 - flake8 --format=html --htmldir={toxinidir}/_build/flake8 src setup.py flake8 src setup.py @@ -133,19 +144,30 @@ whitelist_externals = mkdir [testenv:docs] -skip_install = True +basepython = python +skip_install = False +usedevelop = True +extras = + tests + deps = Sphinx commands = + python -V + mkdir -p {toxinidir}/_build/docs sphinx-build -b html -d _build/docs/doctrees docs _build/docs/html # sphinx-build -b doctest docs _build/docs/doctrees +whitelist_externals = + mkdir + [testenv:towncrier] +basepython = python skip_install = True deps= towncrier commands = - towncrier --draft \ No newline at end of file + towncrier --draft From 581e3f816b7fcf0d11fe6fd9bdd92b2281b0ec59 Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Sun, 31 Jan 2021 01:13:42 +0100 Subject: [PATCH 04/14] tox and buildout, + travis-ci --- .travis.yml | 20 +++++++++++++++++++- base.cfg | 4 ++-- news/448.feature | 8 +++++++- plone-4.3.x-archetypes.cfg | 6 ++---- plone-4.3.x.cfg | 5 +++++ plone-5.0.x-archetypes.cfg | 6 ++---- plone-5.1.x-archetypes.cfg | 6 ++---- tox.ini | 26 +++++++++++++------------- 8 files changed, 52 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7195292a..7eb420ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ matrix: fast_finish: true include: # pyXX-plone_sunburst,pyXX-plone_barceloneta + - python: "3.9" + env: TOXENV=isort,lint,docs, - python: "2.7" env: TOXENV=py27-plone-4.3 - python: "2.7" @@ -18,7 +20,23 @@ matrix: - python: "2.7" env: TOXENV=py27-plone-5.1 - python: "2.7" - env: TOXENV=isort,flake8,docs, + env: TOXENV=py27-plone-5.2 + - python: "2.7" + env: TOXENV=py27-plone-4.3-archetypes + - python: "2.7" + env: TOXENV=py27-plone-5.0-archetypes + - python: "2.7" + env: TOXENV=py27-plone-5.1-archetypes + - python: "2.7" + env: TOXENV=py27-plone-5.2-archetypes + - python: "3.6" + env: TOXENV=py36-plone-5.2 + - python: "3.7" + env: TOXENV=py37-plone-5.2 + - python: "3.8" + env: TOXENV=py38-plone-5.2 + - python: "9.9" + env: TOXENV=py39-plone-5.2 before_install: - mkdir -p $HOME/buildout-cache/{downloads,eggs,extends} diff --git a/base.cfg b/base.cfg index 7381a821..d94225b0 100644 --- a/base.cfg +++ b/base.cfg @@ -12,8 +12,8 @@ socket-timeout = 5 [versions] plone.api = -setuptools = 33.1.1 -zc.buildout = 2.8.0 +#setuptools = 33.1.1 +#zc.buildout = 2.8.0 [omelette] recipe = collective.recipe.omelette diff --git a/news/448.feature b/news/448.feature index 66e358dd..c620ee72 100644 --- a/news/448.feature +++ b/news/448.feature @@ -1,2 +1,8 @@ Improve tox.ini so that plone.api could be tested locally. -[loechel] \ No newline at end of file +[loechel] + +Add all tests to travis-ci config +[loechel] + +Add .editorconfig file to plone.api to help enforce coding conventions +[loechel] diff --git a/plone-4.3.x-archetypes.cfg b/plone-4.3.x-archetypes.cfg index b7e43ea4..4fc92d4c 100644 --- a/plone-4.3.x-archetypes.cfg +++ b/plone-4.3.x-archetypes.cfg @@ -1,7 +1,5 @@ [buildout] extends = - https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg - base.cfg + plone-4.3.x.cfg - -package-extras = [test,archetypes] \ No newline at end of file +package-extras = [test,archetypes] diff --git a/plone-4.3.x.cfg b/plone-4.3.x.cfg index 1661cec9..1b724355 100644 --- a/plone-4.3.x.cfg +++ b/plone-4.3.x.cfg @@ -2,3 +2,8 @@ extends = https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg base.cfg + +[versions] +Pillow = 3.4.2 +setuptools = 33.1.1 +zc.buildout = 2.8.0 diff --git a/plone-5.0.x-archetypes.cfg b/plone-5.0.x-archetypes.cfg index 4e37fe1b..a76ecdf2 100644 --- a/plone-5.0.x-archetypes.cfg +++ b/plone-5.0.x-archetypes.cfg @@ -1,7 +1,5 @@ [buildout] extends = - https://raw.github.com/collective/buildout.plonetest/master/test-5.0.x.cfg - base.cfg + plone-5.0.x.cfg - -package-extras = [test,archetypes] \ No newline at end of file +package-extras = [test,archetypes] diff --git a/plone-5.1.x-archetypes.cfg b/plone-5.1.x-archetypes.cfg index 9b47fb63..fb23e7d3 100644 --- a/plone-5.1.x-archetypes.cfg +++ b/plone-5.1.x-archetypes.cfg @@ -1,7 +1,5 @@ [buildout] extends = - https://raw.github.com/collective/buildout.plonetest/master/test-5.1.x.cfg - base.cfg + plone.5.1.x.cfg - -package-extras = [test,archetypes] \ No newline at end of file +package-extras = [test,archetypes] diff --git a/tox.ini b/tox.ini index 0de2287e..7f5be767 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = - py27-plone-{4.3,5.0,5.1}, - py27-plone-{4.3,5.0,5.1}-archetypes, - py{27,36,37,38,39}-plone-{5.2}, + py27-plone-{4.3,5.0,5.1,5.2}, + py27-plone-{4.3,5.0,5.1,5.2}-archetypes, + py{36,37,38,39}-plone-{5.2}, docs, # black-check, isort, @@ -26,7 +26,7 @@ basepython: py39: python3.9 commands = - python -V + python -VV pip list mkdir -p {toxinidir}/reports/coverage {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} bootstrap @@ -45,8 +45,8 @@ setenv = deps = pdbpp - setuptools==33.1.1 - zc.buildout==2.8.0 + setuptools + zc.buildout coverage whitelist_externals = @@ -62,7 +62,7 @@ setenv = skip_install = True commands = - python -V + python -VV coverage erase coverage combine coverage report @@ -76,7 +76,7 @@ deps = black commands = - python -V + python -VV black --line-length=79 --check --diff -v --skip-string-normalization src setup.py [testenv:black-enforce] @@ -86,7 +86,7 @@ deps = black commands = - python -V + python -VV black -v --line-length=79 --skip-string-normalization src setup.py [testenv:isort-apply] @@ -97,7 +97,7 @@ deps = isort commands = - python -V + python -VV isort {toxinidir}/src setup.py {posargs} [testenv:isort] @@ -107,7 +107,7 @@ deps = isort commands = - python -V + python -VV isort --check-only --diff {toxinidir}/src setup.py [testenv:lint] @@ -135,7 +135,7 @@ deps = flake8_strict commands = - python -V + python -VV mkdir -p {toxinidir}/_build/flake8 - flake8 --format=html --htmldir={toxinidir}/_build/flake8 src setup.py flake8 src setup.py @@ -154,7 +154,7 @@ deps = Sphinx commands = - python -V + python -VV mkdir -p {toxinidir}/_build/docs sphinx-build -b html -d _build/docs/doctrees docs _build/docs/html # sphinx-build -b doctest docs _build/docs/doctrees From 9250558c270831dc25e3db5955f450c35115b07c Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Sun, 31 Jan 2021 15:19:17 +0100 Subject: [PATCH 05/14] fix a typo in travis-ci --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7eb420ea..595ae27f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ global: matrix: fast_finish: true include: - # pyXX-plone_sunburst,pyXX-plone_barceloneta - python: "3.9" env: TOXENV=isort,lint,docs, - python: "2.7" @@ -35,7 +34,7 @@ matrix: env: TOXENV=py37-plone-5.2 - python: "3.8" env: TOXENV=py38-plone-5.2 - - python: "9.9" + - python: "3.9" env: TOXENV=py39-plone-5.2 before_install: @@ -48,7 +47,7 @@ before_install: - echo "abi-tag-eggs = true" >> $HOME/.buildout/default.cfg install: - - travis_retry pip install -U setuptools==33.1.1 tox coveralls coverage + - travis_retry pip install -U pip tox coveralls coverage before_script: - export DISPLAY=:99.0 From 652f4d9560f12f9c9a3fa50672f5eeb9c79a764b Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Sun, 31 Jan 2021 20:55:08 +0100 Subject: [PATCH 06/14] tox and travis settings --- .travis.yml | 6 +++--- tox.ini | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 595ae27f..99804ded 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,9 +49,9 @@ before_install: install: - travis_retry pip install -U pip tox coveralls coverage -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start +#before_script: +# - export DISPLAY=:99.0 +# - sh -e /etc/init.d/xvfb start script: - travis_retry tox diff --git a/tox.ini b/tox.ini index 7f5be767..0292f589 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,8 @@ basepython: commands = python -VV pip list + echo "{toxinidir}" + echo "{envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir}" mkdir -p {toxinidir}/reports/coverage {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} bootstrap {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} @@ -51,6 +53,7 @@ deps = whitelist_externals = mkdir + echo [testenv:coverage-report] basepython = python From 099abd00d803eaa429798fcb823305691ef513f0 Mon Sep 17 00:00:00 2001 From: Alexander Loechel Date: Mon, 1 Feb 2021 00:00:20 +0100 Subject: [PATCH 07/14] change travis-ci, separte lintings and docs --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99804ded..68ccc99f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,9 @@ matrix: fast_finish: true include: - python: "3.9" - env: TOXENV=isort,lint,docs, + env: TOXENV=isort,lint + - python: "3.9" + env: TOXENV=docs - python: "2.7" env: TOXENV=py27-plone-4.3 - python: "2.7" From e990c5d6cf11e2732b833d575f2cc25e037e6b5f Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sun, 28 Feb 2021 00:13:24 +0100 Subject: [PATCH 08/14] Fix tox not finding the buildout config after buildout has restarted. --- tox.ini | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 0292f589..c83aa90e 100644 --- a/tox.ini +++ b/tox.ini @@ -28,9 +28,11 @@ basepython: commands = python -VV pip list - echo "{toxinidir}" - echo "{envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir}" mkdir -p {toxinidir}/reports/coverage +# Calling bin/buildout -c toxinidir/buildout.cfg works in principle. +# But when buildout restarts because it has upgraded or downgraded itself, +# it will fail to find the buildout config file in the envdir. +# So make sure the versions in the deps match what is in the buildout config. {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} bootstrap {envbindir}/buildout -c {toxinidir}/{env:BUILDOUT_FILE} buildout:directory={envdir} buildout:develop={toxinidir} {envbindir}/coverage run {envbindir}/test -v1 --auto-color {posargs} @@ -47,8 +49,8 @@ setenv = deps = pdbpp - setuptools - zc.buildout + setuptools==42.0.2 + zc.buildout==2.13.3 coverage whitelist_externals = From 16649b96bd8eea96b318f4897ad3224fdff1bf11 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sun, 28 Feb 2021 00:17:24 +0100 Subject: [PATCH 09/14] Bumped version for feature release. [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d0dadd38..dfeb8542 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ def read(*rnames): read('CHANGES.rst') + '\n\n' + \ read('LICENSE') -version = '1.10.5.dev0' +version = '1.11.0.dev0' setup( name='plone.api', From ee9982652f10636180f0f34aff7d6a0c225a48d1 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sun, 28 Feb 2021 00:23:56 +0100 Subject: [PATCH 10/14] Drop support for Plone 4.3, 5.0, 5.1, add support for 6.0. The code might still work, but it is no longer tested. You can use releases in the 1.10 series on the older versions. --- .travis.yml | 12 ------------ buildout.cfg | 2 +- news/431.feature | 4 ++++ plone-4.3.x-archetypes.cfg | 5 ----- plone-4.3.x.cfg | 9 --------- plone-5.0.x-archetypes.cfg | 5 ----- plone-5.0.x.cfg | 5 ----- plone-5.1.x-archetypes.cfg | 5 ----- plone-5.1.x.cfg | 4 ---- setup.py | 4 +--- tox.ini | 11 +++-------- 11 files changed, 9 insertions(+), 57 deletions(-) create mode 100644 news/431.feature delete mode 100644 plone-4.3.x-archetypes.cfg delete mode 100644 plone-4.3.x.cfg delete mode 100644 plone-5.0.x-archetypes.cfg delete mode 100644 plone-5.0.x.cfg delete mode 100644 plone-5.1.x-archetypes.cfg delete mode 100644 plone-5.1.x.cfg diff --git a/.travis.yml b/.travis.yml index cb08e0f1..569e5d8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,20 +14,8 @@ matrix: env: TOXENV=isort,lint - python: "3.9" env: TOXENV=docs - - python: "2.7" - env: TOXENV=py27-plone-4.3 - - python: "2.7" - env: TOXENV=py27-plone-5.0 - - python: "2.7" - env: TOXENV=py27-plone-5.1 - python: "2.7" env: TOXENV=py27-plone-5.2 - - python: "2.7" - env: TOXENV=py27-plone-4.3-archetypes - - python: "2.7" - env: TOXENV=py27-plone-5.0-archetypes - - python: "2.7" - env: TOXENV=py27-plone-5.1-archetypes - python: "2.7" env: TOXENV=py27-plone-5.2-archetypes - python: "3.6" diff --git a/buildout.cfg b/buildout.cfg index 464b24b2..f45087fb 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -1,2 +1,2 @@ [buildout] -extends = plone-5.1.x.cfg +extends = plone-5.2.x.cfg diff --git a/news/431.feature b/news/431.feature new file mode 100644 index 00000000..fb6d9bb4 --- /dev/null +++ b/news/431.feature @@ -0,0 +1,4 @@ +Drop support for Plone 4.3, 5.0, 5.1, add support for 6.0. +The code might still work, but it is no longer tested. +You can use releases in the 1.10 series on the older versions. +[maurits] diff --git a/plone-4.3.x-archetypes.cfg b/plone-4.3.x-archetypes.cfg deleted file mode 100644 index 4fc92d4c..00000000 --- a/plone-4.3.x-archetypes.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[buildout] -extends = - plone-4.3.x.cfg - -package-extras = [test,archetypes] diff --git a/plone-4.3.x.cfg b/plone-4.3.x.cfg deleted file mode 100644 index 1b724355..00000000 --- a/plone-4.3.x.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[buildout] -extends = - https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg - base.cfg - -[versions] -Pillow = 3.4.2 -setuptools = 33.1.1 -zc.buildout = 2.8.0 diff --git a/plone-5.0.x-archetypes.cfg b/plone-5.0.x-archetypes.cfg deleted file mode 100644 index a76ecdf2..00000000 --- a/plone-5.0.x-archetypes.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[buildout] -extends = - plone-5.0.x.cfg - -package-extras = [test,archetypes] diff --git a/plone-5.0.x.cfg b/plone-5.0.x.cfg deleted file mode 100644 index ea52eaa3..00000000 --- a/plone-5.0.x.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[buildout] -extends = - https://raw.github.com/collective/buildout.plonetest/master/test-5.0.x.cfg - base.cfg - \ No newline at end of file diff --git a/plone-5.1.x-archetypes.cfg b/plone-5.1.x-archetypes.cfg deleted file mode 100644 index fb23e7d3..00000000 --- a/plone-5.1.x-archetypes.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[buildout] -extends = - plone.5.1.x.cfg - -package-extras = [test,archetypes] diff --git a/plone-5.1.x.cfg b/plone-5.1.x.cfg deleted file mode 100644 index 7d78352e..00000000 --- a/plone-5.1.x.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[buildout] -extends = - https://raw.github.com/collective/buildout.plonetest/master/test-5.1.x.cfg - base.cfg diff --git a/setup.py b/setup.py index dfeb8542..7219197f 100644 --- a/setup.py +++ b/setup.py @@ -59,10 +59,8 @@ def read(*rnames): 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Plone', - 'Framework :: Plone :: 4.3', - 'Framework :: Plone :: 5.0', - 'Framework :: Plone :: 5.1', 'Framework :: Plone :: 5.2', + 'Framework :: Plone :: 6.0', 'Framework :: Plone :: Core', 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', diff --git a/tox.ini b/tox.ini index c83aa90e..edd73a68 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = - py27-plone-{4.3,5.0,5.1,5.2}, - py27-plone-{4.3,5.0,5.1,5.2}-archetypes, + py27-plone-5.2, + py27-plone-5.2-archetypes, py{36,37,38,39}-plone-{5.2}, docs, # black-check, @@ -39,12 +39,7 @@ commands = setenv = COVERAGE_FILE=.coverage.{envname} - plone-4.3-archetypes: BUILDOUT_FILE="plone-4.3.x-archetypes.cfg" - plone-5.0-archetypes: BUILDOUT_FILE="plone-5.0.x-archetypes.cfg" - plone-5.1-archetypes: BUILDOUT_FILE="plone-5.1.x-archetypes.cfg" - plone-4.3: BUILDOUT_FILE="plone-4.3.x.cfg" - plone-5.0: BUILDOUT_FILE="plone-5.0.x.cfg" - plone-5.1: BUILDOUT_FILE="plone-5.1.x.cfg" + plone-5.2-archetypes: BUILDOUT_FILE="plone-5.2.x-archetypes.cfg" plone-5.2: BUILDOUT_FILE="plone-5.2.x.cfg" deps = From 947f328fdcb3e933206fcdda14e55ae01396b200 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sun, 28 Feb 2021 00:52:16 +0100 Subject: [PATCH 11/14] Do not test Plone 5.2 with python 3.9. Theoretically our tests might work, but there is definitely other code that would have test failures, so you should not use it on 5.2. And no easy way to already test on 6.0. But we have buildout.coredev and Jenkins. --- tox.ini | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index edd73a68..c1bae1cf 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = py27-plone-5.2, py27-plone-5.2-archetypes, - py{36,37,38,39}-plone-{5.2}, + py{36,37,38}-plone-{5.2}, docs, # black-check, isort, @@ -13,17 +13,12 @@ skip_missing_interpreters = False [testenv] skip_install = True -#usedevelop = True -#extras = -# test -# archetypes: archetypes basepython: py27: python2.7 py36: python3.6 py37: python3.7 py38: python3.8 - py39: python3.9 commands = python -VV From 3ebe2544665078d77558a2fca1d366fc95a195a1 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Mon, 1 Mar 2021 11:45:02 +0100 Subject: [PATCH 12/14] Removed py39-plone-5.2 tox env. I thought I did that already, but this was only in tox.ini. It was still in the travis config. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 569e5d8f..aeac920b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,6 @@ matrix: env: TOXENV=py37-plone-5.2 - python: "3.8" env: TOXENV=py38-plone-5.2 - - python: "3.9" - env: TOXENV=py39-plone-5.2 before_install: - mkdir -p $HOME/buildout-cache/{downloads,eggs,extends} From bb838adf2a0b120703050fe8890ad8268dc71ac7 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Mon, 1 Mar 2021 11:46:22 +0100 Subject: [PATCH 13/14] Use Python 3.8 instead of 3.9 for the isort/lint/docs envs. Seems better, as the other envs at most use 3.8. And on Travis the docs env fails, with no output. Maybe this helps. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index aeac920b..293c3cde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,9 @@ global: matrix: fast_finish: true include: - - python: "3.9" + - python: "3.8" env: TOXENV=isort,lint - - python: "3.9" + - python: "3.8" env: TOXENV=docs - python: "2.7" env: TOXENV=py27-plone-5.2 From b1ea27aae649641d5071926f6344852501a56f73 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 4 Mar 2021 10:39:55 +0100 Subject: [PATCH 14/14] Tox: run Sphinx docs on Python 3.7. See also the closed PR https://github.com/plone/plone.api/pull/455 where I try a few Python versions and add some comments. --- .travis.yml | 2 +- tox.ini | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 293c3cde..d3dc6bd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: include: - python: "3.8" env: TOXENV=isort,lint - - python: "3.8" + - python: "3.7" env: TOXENV=docs - python: "2.7" env: TOXENV=py27-plone-5.2 diff --git a/tox.ini b/tox.ini index c1bae1cf..777f7cca 100644 --- a/tox.ini +++ b/tox.ini @@ -139,6 +139,9 @@ whitelist_externals = mkdir [testenv:docs] +# Locally for Maurits this only works with Python 2.7. +# Travis is happy with 3.7, not with 3.8 or 3.9. +# So pick the right one in .travis.yml (or GitHub Actions). basepython = python skip_install = False usedevelop = True