diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ecb653d15..f0cf2a144a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,27 +6,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.7, 3.6, 2.7] - plone-version: [5.2, 5.1, 4.3] - exclude: - - python-version: 3.6 - plone-version: 4.3 - - python-version: 3.6 - plone-version: 5.0 - - python-version: 3.6 - plone-version: 5.1 - - python-version: 3.7 - plone-version: 4.3 - - python-version: 3.7 - plone-version: 5.0 - - python-version: 3.7 - plone-version: 5.1 - - python-version: 3.8 - plone-version: 4.3 - - python-version: 3.8 - plone-version: 5.0 - - python-version: 3.8 - plone-version: 5.1 + python-version: [3.8, 3.7] + plone-version: [5.2] steps: # git checkout @@ -42,7 +23,7 @@ jobs: - uses: actions/cache@v1 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- @@ -64,7 +45,7 @@ jobs: # build sphinx - name: sphinx - run: if [ "${{ matrix.plone-version }}" == "5.2" ] && [ ${{ matrix.python-version }} == '3.7' ]; then bin/sphinxbuilder; fi + run: if [ "${{ matrix.plone-version }}" == "5.2" ] && [ ${{ matrix.python-version }} == '3.8' ]; then bin/sphinxbuilder; fi # test - name: test @@ -79,4 +60,53 @@ jobs: # test sphinx warnings - name: sphinx - run: if [ "${{ matrix.plone-version }}" == "5.2" ] && [ ${{ matrix.python-version }} == '3.7' ]; then bin/test-no-sphinx-warnings; fi + run: if [ "${{ matrix.plone-version }}" == "5.2" ] && [ ${{ matrix.python-version }} == '3.8' ]; then bin/test-no-sphinx-warnings; fi + + build-py2: + runs-on: ubuntu-20.04 + container: + image: python:2.7.18-buster + strategy: + fail-fast: false + matrix: + python-version: [2.7] + plone-version: [5.2, 5.1, 4.3] + + steps: + # git checkout + - uses: actions/checkout@v2 + + # python cache + - uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + # python install + - run: pip install virtualenv + - run: pip install wheel + - name: pip install + run: pip install -r requirements.txt + + # buildout + - name: buildout + run: buildout -t 10 -c plone-${{ matrix.plone-version }}.x.cfg code-analysis:return-status-codes=True + env: + CI: true + + # code analysis + - name: code analysis + run: bin/code-analysis + + # test + - name: test + run: bin/test + + # test no uncommited changes + - name: test no uncommited changes + run: bin/test-no-uncommitted-doc-changes + env: + PYTHON_VERSION: ${{ matrix.python-version }} + PLONE_VERSION: ${{ matrix.plone-version }} diff --git a/news/1721.feature b/news/1721.feature new file mode 100644 index 0000000000..e656fa9b2c --- /dev/null +++ b/news/1721.feature @@ -0,0 +1,2 @@ +New version pins to run tests +[erral] diff --git a/plone-4.3.x.cfg b/plone-4.3.x.cfg index 1278c56a8d..6c5e89d6c5 100644 --- a/plone-4.3.x.cfg +++ b/plone-4.3.x.cfg @@ -23,3 +23,9 @@ six = 1.12.0 # latest version compatible with Python 2 plone.schema = 1.4.0 + +# latest version compatible with Python 2 +sphinxcontrib-websupport = 1.1.2 +stdlib-list = 0.6.0 +zest.pocompile = 1.6.0 +plone.rest = 3.0.2 diff --git a/plone-5.1.x.cfg b/plone-5.1.x.cfg index edd3d53367..8854696f9a 100644 --- a/plone-5.1.x.cfg +++ b/plone-5.1.x.cfg @@ -15,3 +15,6 @@ pyparsing = 2.4.7 # Required by plone.restapi six = 1.12.0 +stdlib-list = 0.6.0 +zest.pocompile= 1.6.0 +plone.rest = 3.0.2 diff --git a/plone-5.2.x.cfg b/plone-5.2.x.cfg index cbd4374065..00e4cd406f 100644 --- a/plone-5.2.x.cfg +++ b/plone-5.2.x.cfg @@ -19,3 +19,4 @@ importlib-metadata = 2.0.0 # latest version compatible with Python 2 flake8-print = 4.0.1 +zest.pocompile= 1.6.0 diff --git a/src/plone/restapi/tests/test_dxfield_serializer.py b/src/plone/restapi/tests/test_dxfield_serializer.py index 288992b8fb..0562a25d6e 100644 --- a/src/plone/restapi/tests/test_dxfield_serializer.py +++ b/src/plone/restapi/tests/test_dxfield_serializer.py @@ -41,14 +41,20 @@ def setUp(self): ] def serialize(self, fieldname, value): + field = None for schema in iterSchemata(self.doc1): if fieldname in schema: field = schema.get(fieldname) break - dm = getMultiAdapter((self.doc1, field), IDataManager) - dm.set(value) - serializer = getMultiAdapter((field, self.doc1, self.request), IFieldSerializer) - return serializer() + if field is not None: + dm = getMultiAdapter((self.doc1, field), IDataManager) + dm.set(value) + serializer = getMultiAdapter( + (field, self.doc1, self.request), IFieldSerializer + ) + return serializer() + + return None def test_ascii_field_serialization_returns_unicode(self): value = self.serialize("test_ascii_field", "foo") diff --git a/test-no-uncommitted-doc-changes.in b/test-no-uncommitted-doc-changes.in index 43e15b81f1..c2ad9929e4 100644 --- a/test-no-uncommitted-doc-changes.in +++ b/test-no-uncommitted-doc-changes.in @@ -13,12 +13,12 @@ function red { echo "$RED $1 $RESET" } -if [ "$PLONE_VERSION" == "5.2" ] && [ "$PYTHON_VERSION" == '3.7' ]; then - echo "Running check for undocumented changes for Plone 5.2.x on Python 3.7" +if [ "$PLONE_VERSION" == "5.2" ] && [ "$PYTHON_VERSION" == '3.8' ]; then + echo "Running check for undocumented changes for Plone 5.2.x on Python 3.8" else # request/response dumps have known differences for Plone 5 # => skip, we can't have the Plone 5 build fail because of those - echo "Skipping checks for undocumented changes for everything except Plone 5.2.x on Python 3.7" + echo "Skipping checks for undocumented changes for everything except Plone 5.2.x on Python 3.8" exit 0 fi