Github Action to setup Plone & Python (Using Pip-based Plone installation)

To help add-on developers, and the general Plone developer community, prepare for pip-based installations of Plone, the Installers team released the first version of plone/setup-plone

Our goal is to implement the toolset needed for proper support of Plone installations with pip

Summary

  • Supports Plone 5.2 and Plone 6.0 (Python 3.7 or superior)
  • Packages should not use <includeDependencies package="." /> (Replace it with explicit includes of other packages)
  • Until pip is fixed, always use --use-deprecated legacy-resolver option during installation.
  • Still dealing with robot-framework tests (Help needed, btw)

Examples
Usage on pas.plugins.authomatic

name: Build and test

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python:
          - 3.7
          - 3.8
          - 3.9
        plone:
          - "6.0.0a1"
          - "5.2-latest"
        exclude:
          - plone: "5.2-latest"
            python: 3.9

    steps:
    - uses: actions/checkout@v2

    - name: Setup Plone ${{ matrix.plone }} with Python ${{ matrix.python }}
      id: setup
      uses: plone/setup-plone@v1.0.0
      with:
        python-version: ${{ matrix.python }}
        plone-version: ${{ matrix.plone }}

    # Install pas.plugins.authomatic with test extras
    - name: Install pas.plugins.authomatic
      run: |
        pip install ".[test]" --use-deprecated legacy-resolver
    # test
    - name: test
      run: |
        zope-testrunner --auto-color --auto-progress --test-path src

Usage on plone.volto

name: Tests
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python: [3.7, 3.8, 3.9]
        plone: ["6.0.0a1", "5.2-latest"]
        exclude:
          - plone: "5.2-latest"
            python: 3.9

    steps:
      # git checkout
      - uses: actions/checkout@v2

      - name: Setup Plone ${{ matrix.plone }} with Python ${{ matrix.python }}
        id: setup
        uses: plone/setup-plone@v1.0.0
        with:
          python-version: ${{ matrix.python }}
          plone-version: ${{ matrix.plone }}

      # Install plone.volto with test extras
      - name: Install plone.volto
        run: |
          pip install ".[test]" --use-deprecated legacy-resolver
      # test
      - name: test
        run: |
          zope-testrunner --auto-color --auto-progress --test-path src

Next Steps

  • Implement lint checkers (Flake 8, isort, black)
  • Cache Python x Plone combinations
4 Likes

The marketplace link is Setup Plone & Python · Actions · GitHub Marketplace · GitHub

2 Likes

Example with Makefile in place plone.org/test-backend.yml at main · plone/plone.org · GitHub

2 Likes

I get a 404 on this... where did it get moved to?

Available at https://github.com/marketplace/actions/setup-plone-python

2 Likes

This is failing for me now... pip error: no such option: --use-deprecated · Issue #32 · plone/ploneconf.org · GitHub