Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
include =
src/plone/*
omit =
*/test*
*/upgrades/*
57 changes: 0 additions & 57 deletions .github/workflows/ci.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Push tests
# run-name: ${{ github.actor }} push tests

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- python: 3.7.14
plone: 5.2
- python: 3.10.11
plone: "6.0"
- python: 3.13.1
plone: "6.1"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: "${{ matrix.python }}"
- name: Setup Env
run: |
pip install --upgrade pip
pip install -r requirements-${{ matrix.plone }}.txt
- name: Cache eggs
uses: actions/cache@v4
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }}
- name: buildout
run: |
sed -ie "s#test.cfg#test-${{matrix.plone}}.cfg#" gha.cfg
buildout -c gha.cfg annotate
buildout -c gha.cfg
- name: test
run: |
bin/test -t !robot
coverage:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- python: 3.10.11
plone: "6.0"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pyenv and Python
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: "${{ matrix.python }}"
- name: Setup Env
run: |
pip install --upgrade pip
pip install -r requirements-${{matrix.plone}}.txt
pip install -U coveralls coverage
- name: Cache eggs
uses: actions/cache@v4
env:
cache-name: cache-eggs
with:
path: ~/buildout-cache/eggs
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ matrix.python }}-${{ matrix.plone }}
- name: buildout
run: |
sed -ie "s#test.cfg#test-${{matrix.plone}}.cfg#" gha.cfg
buildout -c gha.cfg
- name: code-analysis
run: |
bin/code-analysis
- name: test coverage
run: |
coverage run bin/test -t !robot
- name: Publish to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coveralls --service=github
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.py[co]
.python-version

# Packages
*.egg
Expand Down Expand Up @@ -42,3 +43,4 @@ local.cfg
/pyvenv.cfg

/pip-selfcheck.json
/.plone.versioncheck.tracked.json
5 changes: 5 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[settings]
force_alphabetical_sort = True
force_single_line = True
lines_after_imports = 2
line_length = 120
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
3.0.1 (unreleased)
------------------

- Nothing changed yet.
- Plone6 compatibility.
[cekk]


3.0.0 (2024-06-05)
Expand Down
180 changes: 100 additions & 80 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,85 +1,105 @@
# keep in sync with: https://github.com/kitconcept/buildout/edit/master/Makefile
# update by running 'make update'
SHELL := /bin/bash
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
#!/usr/bin/make
# pyenv is a requirement, with 3.8, 3.10, 3.13 python versions, and virtualenv installed in each version
# plone parameter must be passed to create environment 'make setup plone=6.1' or after a make cleanall
# The original Makefile can be found on https://github.com/IMIO/scripts-buildout

SHELL=/bin/bash
plones=5.2 6.0 6.1
b_o=
old_plone=$(shell [ -e .plone-version ] && cat .plone-version)

ifeq (, $(shell which pyenv))
$(error "pyenv command not found! Aborting")
endif

ifndef plone
ifeq (,$(filter setup,$(MAKECMDGOALS)))
plone=$(old_plone)
endif
endif

ifneq ($(wildcard bin/instance),)
b_o=-N
endif

ifndef python
ifeq ($(plone),5.2)
python=3.8
endif
ifeq ($(plone),6.0)
python=3.10
endif
ifeq ($(plone),6.1)
python=3.13
endif
endif

all: buildout

version = 3

# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`

all: .installed.cfg

# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
.PHONY: help
help: ## This help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
help:
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

<<<<<<< HEAD
.installed.cfg: bin/buildout *.cfg
bin/buildout

bin/buildout: bin/pip
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/pip install black || true
@touch -c $@

bin/python bin/pip:
python$(version) -m venv . || virtualenv --python=python$(version) .

.PHONY: Build Plone 5.2
build-plone-5.2: .installed.cfg ## Build Plone 5.2
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-5.2.x.cfg

.PHONY: Build Plone 5.2 Performance
build-plone-5.2-performance: .installed.cfg ## Build Plone 5.2
bin/pip install --upgrade pip
bin/pip install -r requirements.txt
bin/buildout -c plone-5.2.x-performance.cfg

.PHONY: Test
test: ## Test
bin/test

.PHONY: Test Performance
test-performance:
jmeter -n -t performance.jmx -l jmeter.jtl

.PHONY: Code Analysis
code-analysis: ## Code Analysis
bin/code-analysis
if [ -f "bin/black" ]; then bin/black src/ --check ; fi

.PHONY: Black
black: ## Black
bin/code-analysis
if [ -f "bin/black" ]; then bin/black src/ ; fi

.PHONY: zpretty
zpretty: ## zpretty
if [ -f "bin/zpretty" ]; then zpretty -i ./**/*.zcml; fi

.PHONY: Build Docs
docs: ## Build Docs
bin/sphinxbuilder

.PHONY: Test Release
test-release: ## Run Pyroma and Check Manifest
bin/pyroma -n 10 -d .

.PHONY: Release
release: ## Release
bin/fullrelease

.PHONY: Clean
clean: ## Clean
git clean -Xdf

.PHONY: all clean
=======
.python-version: ## Setups pyenv version
@pyenv local `pyenv versions |grep " $(python)" |tail -1 |xargs`
@echo "Local pyenv version is `cat .python-version`"
@ if [[ `pyenv which virtualenv` != `pyenv prefix`* ]] ; then echo "You need to install virtualenv in `cat .python-version` pyenv python (pip install virtualenv)"; exit 1; fi

bin/buildout: .python-version ## Setups environment
virtualenv .
./bin/pip install --upgrade pip
./bin/pip install -r requirements-$(plone).txt
@echo "$(plone)" > .plone-version
>>>>>>> 261a812 (Update buildout to Plone 6.1)

.PHONY: setup
setup: oneof-plone backup cleanall bin/buildout restore ## Setups environment

.PHONY: buildout
buildout: oneof-plone bin/buildout ## Runs setup and buildout
rm -f .installed.cfg .mr.developer.cfg
bin/buildout -t 5 -c test-$(plone).cfg ${b_o}

.PHONY: test
test: oneof-plone bin/buildout ## run bin/test without robot
# can be run by example with: make test opt='-t "settings"'
bin/test -t \!robot ${opt}

.PHONY: cleanall
cleanall: ## Cleans all installed buildout files
rm -fr bin include lib local share develop-eggs downloads eggs parts .installed.cfg .mr.developer.cfg .python-version pyvenv.cfg

.PHONY: backup
backup: ## Backups db files
@if [ '$(old_plone)' != '' ] && [ -f var/filestorage/Data.fs ]; then mv var/filestorage/Data.fs var/filestorage/Data.fs.$(old_plone); mv var/blobstorage var/blobstorage.$(old_plone); fi

.PHONY: restore
restore: ## Restores db files
@if [ '$(plone)' != '' ] && [ -f var/filestorage/Data.fs.$(plone) ]; then mv var/filestorage/Data.fs.$(plone) var/filestorage/Data.fs; mv var/blobstorage.$(plone) var/blobstorage; fi

.PHONY: which-python
which-python: oneof-plone ## Displays versions information
@echo "current plone = $(old_plone)"
@echo "current python = `cat .python-version`"
@echo "plone var = $(plone)"
@echo "python var = $(python)"

.PHONY: vcr
vcr: ## Shows requirements in checkversion-r.html
@bin/versioncheck -rbo checkversion-r-$(plone).html test-$(plone).cfg

.PHONY: vcn
vcn: ## Shows newer packages in checkversion-n.html
@bin/versioncheck -npbo checkversion-n-$(plone).html test-$(plone).cfg

.PHONY: guard-%
guard-%:
@ if [ "${${*}}" = "" ]; then echo "You must give a value for variable '$*' : like $*=xxx"; exit 1; fi

.PHONY: oneof-%
oneof-%:
@ if ! echo "${${*}s}" | tr " " '\n' |grep -Fqx "${${*}}"; then echo "Invalid '$*' parameter ('${${*}}') : must be one of '${${*}s}'"; exit 1; fi
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.. image:: https://travis-ci.org/collective/plone.formwidget.masterselect.svg
:target: https://travis-ci.org/collective/plone.formwidget.masterselect
.. image:: https://github.com/collective/plone.formwidget.masterselect/actions/workflows/main.yml/badge.svg
:target: https://github.com/collective/plone.formwidget.masterselect/actions/workflows/main.yml

.. image:: https://coveralls.io/repos/github/collective/plone.formwidget.masterselect/badge.svg
:target: https://coveralls.io/github/collective/plone.formwidget.masterselect

.. image:: https://coveralls.io/repos/collective/plone.formwidget.masterselect/badge.png
:target: https://coveralls.io/r/collective/plone.formwidget.masterselect

MasterSelectWidget
==================
Expand All @@ -18,7 +19,7 @@ Feel free to help edit this document to help explain things better!
Example
=======

For more complex examples see ``demo.py`` in pacakge directory.::
For more complex examples see ``demo.py`` in package directory.::

from zope import schema
from plone.supermodel import model
Expand Down
Loading