From 9ecb867c8b8a1f1d4fb8fcf540e27e43d6b6a4a8 Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Tue, 12 Jul 2022 15:22:29 +0200 Subject: [PATCH] switch to mxdev test setup --- .github/workflows/main.yml | 73 +++---- .gitignore | 4 +- .travis.yml.bak | 31 --- .tx/config | 9 - CHANGES.rst | 6 +- Makefile | 394 +++++++++++++++++++++++++++---------- base.cfg | 57 ------ buildout.cfg | 4 - constraints.txt | 1 + instance.yaml | 18 ++ mx.ini | 37 ++++ requirements.txt | 9 +- setup.cfg | 0 setup.py | 10 +- test-5.0.x.cfg | 10 - test-5.1.x.cfg | 5 - test-5.2.x.cfg | 4 - tox.ini | 20 -- 18 files changed, 393 insertions(+), 299 deletions(-) delete mode 100644 .travis.yml.bak delete mode 100644 .tx/config delete mode 100644 base.cfg delete mode 100644 buildout.cfg create mode 100644 constraints.txt create mode 100644 instance.yaml create mode 100644 mx.ini create mode 100644 setup.cfg delete mode 100644 test-5.0.x.cfg delete mode 100644 test-5.1.x.cfg delete mode 100644 test-5.2.x.cfg delete mode 100644 tox.ini diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5b75f3e5..eddf584a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,49 +1,40 @@ -name: CI +name: Test Collective Taxonomy on: - push: - branches-ignore: - - "master" - - "releases/**" - # Allow to run this workflow manually from the Actions tab - workflow_dispatch: + push + jobs: build: + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - config: - # [Python version, tox env] - - ["2.7", "plone50-py27"] - - ["2.7", "plone51-py27"] - - ["2.7", "plone52-py27"] - - ["3.6", "plone52-py36"] - - ["3.7", "plone52-py37"] - - ["3.8", "plone52-py38"] - runs-on: ubuntu-latest - name: ${{ matrix.config[1] }} + python: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + plone: + - "6.0-dev" + steps: - - uses: actions/checkout@v2 - - name: Install lxml dev libraries - # Needed to avoid error on Plone 5.0. - # Error: Please make sure the libxml2 and libxslt development packages are installed. - run: sudo apt-get install libxml2-dev libxslt1-dev - if: matrix.config[1] == 'plone50-py27' - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.config[0] }} - - name: Pip cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.config[0] }}- - ${{ runner.os }}-pip- - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox - - name: Test - run: tox -e ${{ matrix.config[1] }} + - 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 }} + + - name: Install package + run: | + make install + + - name: Run Lint + run: | + make lint + + - name: Run tests + run: | + make test-ignore-warnings diff --git a/.gitignore b/.gitignore index ace21bb7..62c42b36 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,6 @@ lib/ share/ pip-selfcheck.json pyvenv.cfg -lib64 \ No newline at end of file +lib64 +.make-sentinels/ +*-mxdev.txt diff --git a/.travis.yml.bak b/.travis.yml.bak deleted file mode 100644 index e3722a78..00000000 --- a/.travis.yml.bak +++ /dev/null @@ -1,31 +0,0 @@ -version: ~> 1.0 -import: collective/buildout.plonetest:travis/default.yml -jobs: - include: - - python: "2.7" - env: PLONE_VERSION=5.0 - - python: "2.7" - env: PLONE_VERSION=5.1 - - python: "2.7" - env: PLONE_VERSION=5.2 - - python: "3.7" - env: PLONE_VERSION=5.2 -cache: - pip: true - yarn: true - directories: - - $HOME/buildout-cache - - ~/.cache -before_install: - - nvm install 12; - - mkdir -p $HOME/buildout-cache/{eggs,downloads}; - - mkdir $HOME/.buildout; - - echo "[buildout]" > $HOME/.buildout/default.cfg; - - echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg; - - echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg; -install: - - bin/pip install black || true - - bin/buildout -N -t 3 - - make build-frontend -script: - - make test diff --git a/.tx/config b/.tx/config deleted file mode 100644 index f93e6a3a..00000000 --- a/.tx/config +++ /dev/null @@ -1,9 +0,0 @@ -[main] -host = https://www.transifex.com - -[plone-collective.collective-taxonomy-pot] -file_filter = src/collective/taxonomy/locales//LC_MESSAGES/collective.taxonomy.po -minimum_perc = 0 -source_file = src/collective/taxonomy/locales/collective.taxonomy.pot -source_lang = en -type = PO diff --git a/CHANGES.rst b/CHANGES.rst index c05848dd..9896dfb3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,15 +4,13 @@ Changes 3.0.0 (unreleased) ------------------ -- Nothing changed yet. +- Fix configlet icon for Plone 6 (#135) + [laulaz] 2.2.2 (2022-07-12) ------------------ -- Fix configlet icon for Plone 6 (#135) - [laulaz] - - Use new 'Manage taxonomies' permission for taxonomies configlet (#134) Permission is by default assigned to Manager and Site Administrator roles. [laulaz] diff --git a/Makefile b/Makefile index 165e31c3..434e9884 100644 --- a/Makefile +++ b/Makefile @@ -1,127 +1,313 @@ -# convenience makefile to boostrap & run buildout -SHELL := /bin/bash -# Run test if not on Travis or Python 3 and Plone 5.2 -NOT_TRAVIS_OR_PYTHON3_PLONE52 := $(shell if [ -z "$$TRAVIS" ] || ([ "$$PLONE_VERSION" == "5.2" ] && [ "$$TRAVIS_PYTHON_VERSION" == "3.7" ]); then echo "true"; else echo "false"; fi) +# Makefile to configure and run Plone instance -version = 3 +############################################################################## +# SETUP MAKE -# 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` +## Defensive settings for make: https://tech.davis-hansson.com/p/make/ +SHELL:=bash +.ONESHELL: +# for Makefile debugging purposes add -x to the .SHELLFLAGS +.SHELLFLAGS:=-eu -o pipefail -O inherit_errexit -c +.SILENT: +.DELETE_ON_ERROR: +MAKEFLAGS+=--warn-undefined-variables +MAKEFLAGS+=--no-builtin-rules -all: build +# Colors +# OK=Green, warn=yellow, error=red +ifeq ($(TERM),) +# no colors if not in terminal + MARK_COLOR= + OK_COLOR= + WARN_COLOR= + ERROR_COLOR= + NO_COLOR= +else + MARK_COLOR=`tput setaf 6` + OK_COLOR=`tput setaf 2` + WARN_COLOR=`tput setaf 3` + ERROR_COLOR=`tput setaf 1` + NO_COLOR=`tput sgr0` +endif + +############################################################################## +# SETTINGS AND VARIABLE +# adjust to your project needs +PROJECT_NAME=collective.taxonomy +IMAGE_NAME=${PROJECT_NAME} +CONSTRAINTS=constraints.txt +PIP_REQUIREMENTS_IN_FILE=requirements.txt +ADDONBASE=./ +ADDONFOLDER=${ADDONBASE}src/ +# it is possible to define an alternative YAML file for the the instance.set default i +INSTANCE_YAML?=instance.yaml +INSTANCE_FOLDER?=instance + +PIP_PARAMS= --pre + +############################################################################## +# targets and prerequisites +# target has to be one file, otherwise step gets executes for each file separate +PREPARE_PREREQUISITES=${PIP_REQUIREMENTS_IN_FILE} ${CONSTRAINTS} mx.ini ${ADDONBASE}setup.cfg +PREPARE_TARGET=requirements-mxdev.txt +INSTALL_PREREQUSISTES=${PREPARE_TARGET} +INSTALL_TARGET=.installed.txt +INSTANCE_PREREQUISITES=${INSTALL_TARGET} ${INSTANCE_YAML} +INSTANCE_TARGET=${INSTANCE_FOLDER}/etc/zope.ini ${INSTANCE_FOLDER}/etc/zope.conf ${INSTANCE_FOLDER}/etc/site.zcml +TEST_PREREQUISITES=${INSTALL_TARGET} +RUN_PREREQUISITES=${INSTANCE_TARGET} + +############################################################################## +# CONVINIENCE + +# install and run +.PHONY: all # full install, test and run +all:style test run # Add the following 'help' target to your Makefile # And add help text after each target name starting with '\#\#' .PHONY: help -help: ## This help message +help: ## This help message + @echo "${OK_COLOR}This is the Makefile for ${WARN_COLOR}${PROJECT_NAME}${NO_COLOR}" + @echo + @echo "${WARN_COLOR}Additional parameters:${NO_COLOR}" + @echo "${MARK_COLOR}PYTHON${NO_COLOR}: Python interpreter to be used (default: python3)" + @echo "${MARK_COLOR}VENV${NO_COLOR}: [on|off] wether to create a Python virtual environment or not (default: on)"s + @echo "${MARK_COLOR}VENV_FOLDER${NO_COLOR}: location of the virtual environment (default: ./venv)" + @echo + @echo "${WARN_COLOR}Targets:${NO_COLOR}" @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -.PHONY: Build -build: build-backend build-frontend ## Build - -build-backend: - @echo "$(GREEN)==> Setup Build$(RESET)" - python3 -m venv venv - ./venv/bin/pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/buildout bootstrap -ifeq ("$(NOT_TRAVIS_OR_PYTHON3_PLONE52)", "true") - ./venv/bin/pip install black +############################################################################## +# targets and prerequisites +# target has to be one file, otherwise step gets executes for each file separate +PREPARE_PREREQUISITES=${PIP_REQUIREMENTS_IN_FILE} ${CONSTRAINTS} mx.ini ${ADDONBASE}setup.cfg +PREPARE_TARGET=requirements-mxdev.txt +INSTALL_PREREQUSISTES=${PREPARE_TARGET} +INSTALL_TARGET=.installed.txt +INSTANCE_PREREQUISITES=${INSTALL_TARGET} ${INSTANCE_YAML} +INSTANCE_TARGET=${INSTANCE_FOLDER}/etc/zope.ini ${INSTANCE_FOLDER}/etc/zope.conf ${INSTANCE_FOLDER}/etc/site.zcml +TEST_PREREQUISITES=${INSTALL_TARGET} +RUN_PREREQUISITES=${INSTANCE_TARGET} + +############################################################################## +# BASE + +SENTINELFOLDER=.make-sentinels/ +SENTINEL=${SENTINELFOLDER}ABOUT.txt +${SENTINEL}: + @mkdir -p ${SENTINELFOLDER} + @echo "Sentinels for the Makefile process." > ${SENTINEL} + +# PYTHON, VENV, PIP +# venv and pybin +PYTHON?=python3 +VENV?=on +ifeq ("${VENV}", "on") + VENV_FOLDER?=./venv + PYBIN=${VENV_FOLDER}/bin/ +else + VENV_FOLDER?= + ifneq ("${VENV_FOLDER}", "") + PYBIN=${VENV_FOLDER}/bin/ + PYTHON=${PYBIN}python + else + PYBIN= + endif +endif + +# installed? +ifeq (, $(shell which $(PYTHON) )) + $(error "PYTHON=$(PYTHON) not found in $(PATH)") endif - bin/buildout - -build-frontend: - @echo "$(GREEN)==> Build Frontend$(RESET)" - cd src/collective/taxonomy/javascripts && yarn - cd src/collective/taxonomy/javascripts && yarn build - -.PHONY: Start -start: ## Start - if [ "$$(command -v tmux)" ]; then \ - tmux new-session "make start-backend" \; \ - split-window -h "make start-frontend" \; \ - select-pane -t 0; \ - else \ - make start-backend; \ - fi - -start-backend: - @echo "$(GREEN)==> Start Plone Backend$(RESET)" - NODE_ENV=development bin/instance fg - -start-frontend: - @echo "$(GREEN)==> Start Webpack Watcher$(RESET)" - cd src/collective/taxonomy/javascripts && yarn start - -.PHONY: Start Cypress -start-cypress: ## Start Cypress - @echo "$(GREEN)==> Start Cypress$(RESET)" - bin/instance start && while ! nc -z localhost 8080; do sleep 1; done - cd src/collective/taxonomy/javascripts && yarn run cypress open - bin/instance stop - -.PHONY: Test -test: code-format-check code-analysis test-backend test-frontend test-cypress ## Test - -.PHONY: Code Format Check -code-format-check: code-format-check-backend code-format-check-frontend ## Code Format Check - -code-format-check-backend: - @echo "$(GREEN)==> Run Python code format check$(RESET)" -ifeq ("$(NOT_TRAVIS_OR_PYTHON3_PLONE52)", "true") - ./venv/bin/black --check src/ + +# version ok? +PYTHON_VERSION_MIN=3.7 +PYTHON_VERSION_OK=$(shell $(PYTHON) -c 'import sys; print(int(sys.version_info[0:2] >= tuple(map(int, "$(PYTHON_VERSION_MIN)".split(".")))))' ) + +ifeq ($(PYTHON_VERSION_OK),0) + $(error "Need python $(PYTHON_VERSION) >= $(PYTHON_VERSION_MIN)") +endif + +VENV_SENTINEL=${SENTINELFOLDER}venv.sentinel +${VENV_SENTINEL}: ${SENTINEL} +ifeq ("${VENV}", "on") + @echo "$(OK_COLOR)Setup Python Virtual Environment under '${VENV_FOLDER}' $(NO_COLOR)" + @${PYTHON} -m venv ${VENV_FOLDER} +else + @echo "$(OK_COLOR)Use current local or global Python: `which ${PYTHON}` $(NO_COLOR)" endif + @touch ${VENV_SENTINEL} -code-format-check-frontend: - @echo "$(GREEN)==> Run Javascript code format check$(RESET)" - cd src/collective/taxonomy/javascripts && yarn prettier +PIP_SENTINEL=${SENTINELFOLDER}pip.sentinel +${PIP_SENTINEL}: ${VENV_SENTINEL} ${CONSTRAINTS} ${SENTINEL} + @echo "$(OK_COLOR)Install pip$(NO_COLOR)" + @${PYBIN}pip install -U "pip>=22.0.2" wheel setuptools + @touch ${PIP_SENTINEL} -.PHONY: Code Format -code-format: code-format-backend code-format-frontend ## Code Format +############################################################################## +# MXDEV -code-format-backend: - @echo "$(GREEN)==> Run Python code format$(RESET)" - ./venv/bin/black src/ +MXDEV_SENTINEL=${SENTINELFOLDER}pip-mxdev.sentinel +${MXDEV_SENTINEL}: ${PIP_SENTINEL} + @echo "$(OK_COLOR)Install mxdev$(NO_COLOR)" + @${PYBIN}pip install "mxdev==2.1.0" "libvcs==0.11.1" + @touch ${MXDEV_SENTINEL} -code-format-frontend: - @echo "$(GREEN)==> Run Javascript code format$(RESET)" - cd src/collective/taxonomy/javascripts && yarn prettier:fix +.PHONY: prepare +prepare: ${PREPARE_TARGET} ## prepare soures and dependencies -code-analysis: - @echo "$(green)==> Run static code analysis$(reset)" -ifeq ("$(NOT_TRAVIS_OR_PYTHON3_PLONE52)", "true") - bin/code-analysis -endif +${PREPARE_PREREQUISITES}: + @touch $@ + +${PREPARE_TARGET}: ${MXDEV_SENTINEL} ${PREPARE_PREREQUISITES} + @echo "$(OK_COLOR)Prepare sources and dependencies$(NO_COLOR)" + @${PYBIN}mxdev -c mx.ini + +.PHONY: install +install: ${INSTALL_TARGET} ## pip install all dependencies and scripts + +${INSTALL_TARGET}: ${PREPARE_TARGET} + @echo "$(OK_COLOR)Install dependencies and scripts$(NO_COLOR)" + @${PYBIN}pip install -r ${PREPARE_TARGET} ${PIP_PARAMS} + @${PYBIN}pip freeze >${INSTALL_TARGET} + +############################################################################## +# INSTANCE + +COOKIECUTTER_SENTINEL=${SENTINELFOLDER}pip-cookiecutter.sentinel +${COOKIECUTTER_SENTINEL}: + @echo "$(OK_COLOR)Install cookiecutter$(NO_COLOR)" + @${PYBIN}pip install "cookiecutter>=2.1.1" + @touch ${COOKIECUTTER_SENTINEL} + +${INSTANCE_YAML}: + @touch ${INSTANCE_YAML} -test-backend: - @echo "$(GREEN)==> Run Backend Tests$(RESET)" - bin/test --all +.PHONY: instance +instance: ${INSTANCE_TARGET} ## create configuration for an zope (plone) instance -test-frontend: - @echo "$(GREEN)==> Run Frontend Tests$(RESET)" - cd src/collective/taxonomy/javascripts && yarn test +${INSTANCE_TARGET}: ${INSTANCE_PREREQUISITES} ${COOKIECUTTER_SENTINEL} ${INSTANCE_YAML} + @echo "$(OK_COLOR)Create Plone/Zope configuration from ${INSTANCE_YAML} at ${INSTANCE_FOLDER}$(NO_COLOR)" + @${PYBIN}cookiecutter -f --no-input --config-file ${INSTANCE_YAML} https://github.com/plone/cookiecutter-zope-instance -test-cypress: - @echo "$(GREEN)==> Run Cypress Test$(RESET)" -ifeq ("$(NOT_TRAVIS_OR_PYTHON3_PLONE52)", "true") - bin/instance start && while ! nc -z localhost 8080; do sleep 1; done - cd src/collective/taxonomy/javascripts && yarn run cypress run --config video=false - bin/instance stop + +############################################################################## +# TESTING + +TESTRUNNER_SENTINEL=${SENTINELFOLDER}pip-testrunner.sentinel +${TESTRUNNER_SENTINEL}: ${PIP_SENTINEL} + @echo "$(OK_COLOR)Install zope.testrunner$(NO_COLOR)" + @${PYBIN}pip install zope.testrunner + @touch ${TESTRUNNER_SENTINEL} + +.PHONY: test +test: ${TEST_PREREQUISITES} ${TESTRUNNER_SENTINEL} ## run tests + @echo "$(OK_COLOR)Run addon tests$(NO_COLOR)" + @${PYBIN}zope-testrunner --auto-color --auto-progress --test-path=${ADDONFOLDER} + +.PHONY: test-ignore-warnings +test-ignore-warnings: ${TEST_PREREQUISITES} ${TESTRUNNER_SENTINEL} ## run tests (hide warnings) + @echo "$(OK_COLOR)Run addon tests$(NO_COLOR)" + @PYTHONWARNINGS=ignore ${PYBIN}zope-testrunner --auto-color --auto-progress --test-path=${ADDONFOLDER} + +############################################################################## +# CODE FORMATTING + +BLACK_SENTINEL=${SENTINELFOLDER}pip-black.sentinel +${BLACK_SENTINEL}: ${PREPARE_TARGET} + @echo "$(OK_COLOR)Install black$(NO_COLOR)" + @${PYBIN}pip install black + @touch ${BLACK_SENTINEL} + +ISORT_SENTINEL=${SENTINELFOLDER}pip-isort.sentinel +${ISORT_SENTINEL}: ${PREPARE_TARGET} + @echo "$(OK_COLOR)Install isort$(NO_COLOR)" + @${PYBIN}pip install isort + @touch ${ISORT_SENTINEL} + +ZPRETTY_SENTINEL=${SENTINELFOLDER}pip-zpretty.sentinel +${ZPRETTY_SENTINEL}: ${PREPARE_TARGET} + @echo "$(OK_COLOR)Install zpretty$(NO_COLOR)" + @${PYBIN}pip install "zpretty>=2.2.0" + @touch ${ZPRETTY_SENTINEL} + +.PHONY: apply-style-black +apply-style-black: ${BLACK_SENTINEL} ## apply/format code style black (to Python files) + @echo "$(OK_COLOR)Apply style black rules to code in ${ADDONFOLDER}/*$(NO_COLOR)" + @${PYBIN}black ${ADDONFOLDER} + +.PHONY: apply-style-isort +apply-style-isort: ${ISORT_SENTINEL} ## apply/format code style isort (sorted imports in Python files) + @echo "$(OK_COLOR)Apply style isort rules to code in ${ADDONFOLDER}/*$(NO_COLOR)" + @${PYBIN}isort ${ADDONFOLDER} + +.PHONY: apply-style-zpretty +apply-style-zpretty: ${ZPRETTY_SENTINEL} ## apply/format code style zpretty (to XML/ZCML files) + @echo "$(OK_COLOR)Apply style zpretty rules to code in ${ADDONFOLDER}/*$(NO_COLOR)" + @find ${ADDONFOLDER} -name '*.zcml' -exec ${PYBIN}zpretty -iz {} + + @find ${ADDONFOLDER} -name "*.xml"|grep -v locales|xargs ${PYBIN}zpretty -ix + +.PHONY: style ## apply code styles black, isort and zpretty +style: apply-style-black apply-style-isort + +.PHONY: format ## alias for "style" +FORMATTING: style + +.PHONY: lint-black +lint-black: ${BLACK_SENTINEL} ## lint code-style black (to Python files) + @echo "$(OK_COLOR)Lint black rules to code in ${ADDONFOLDER}/*$(NO_COLOR)" + @${PYBIN}black --check ${ADDONFOLDER} + +.PHONY: lint-isort +lint-isort: ${ISORT_SENTINEL} ## lint code-style isort (sorted imports in Python files) + @echo "$(OK_COLOR)Lint style isort rules to code in ${ADDONFOLDER}/*$(NO_COLOR)" + @${PYBIN}isort --check-only ${ADDONFOLDER} + +.PHONY: lint-zpretty +lint-zpretty: ${ZPRETTY_SENTINEL} ## lint code-style zpretty (to XML/ZCML files) + @echo "$(OK_COLOR)Lint style zpretty rules to code in ${ADDONFOLDER}/*$(NO_COLOR)" + @find ${ADDONFOLDER} -name '*.zcml' -exec ${PYBIN}zpretty --check -z {} + + @find ${ADDONFOLDER} -name '*.xml'|grep -v locales|xargs ${PYBIN}zpretty --check -x + +.PHONY: lint ## lint all: check if complies with code-styles black, isort and zpretty +lint: lint-black lint-isort + +############################################################################## +# RUN + +.PHONY: run +run: ${RUN_PREREQUISITES} ## run/start Plone + @echo "$(OK_COLOR)Run Plone$(NO_COLOR)" + @${PYBIN}runwsgi -v instance/etc/zope.ini + +############################################################################## +# CLEAN +.PHONY: clean-venv +clean-venv: ## remove Python virtual environment +ifeq ("${VENV}", "on") + @echo "$(OK_COLOR)Remove Virtualenv.$(NO_COLOR)" + rm -rf ${VENV_FOLDER} ${SENTINELFOLDER}/pip*.sentinel ${VENV_SENTINEL} +else: + @echo "$(OK_WARN)No self-created Python virtualenv at '${VENV_FOLDER}'! Nothing to do.$(NO_COLOR)" endif -test-cypress-foreground: - @echo "$(GREEN)==> Run Cypress Test Displaying Browser$(RESET)" - bin/instance start && while ! nc -z localhost 8080; do sleep 1; done - cd src/collective/taxonomy/javascripts && yarn run cypress run --headed --no-exit - bin/instance stop +.PHONY: clean-pyc +clean-pyc: ## remove Python file artifacts + @echo "$(OK_COLOR)Remove Python file artifacts (like byte-code) of code in current directory.$(NO_COLOR)" + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + find . -name '*~' -exec rm -f {} + + find . -name '__pycache__' -exec rm -fr {} + + +.PHONY: clean-make +clean-make: ## remove make artifact @echo "$(OK_COLOR)Remove Plone/Zope configuration (keeps data) and sentinel files.$(NO_COLOR)" + rm -rf ${INSTALL_PREREQUSISTES} ${INSTANCE_TARGET} ${SENTINELFOLDER} constraints-mxdev.txt -.PHONY: Clean -clean: ## Clean - @echo "$(RED)==> Cleaning environment and build$(RESET)" - git clean -Xdf +.PHONY: clean-instance +clean-instance: ## remove instance configuration (keeps data) + @echo "$(OK_COLOR)Remove Plone/Zope configuration (keeps data) and sentinel files.$(NO_COLOR)" + rm -f ${INSTANCE_TARGET} -.PHONY: all clean +.PHONY: clean +clean: clean-venv clean-pyc clean-make clean-instance ## clean all (except local database and pip installed packages) diff --git a/base.cfg b/base.cfg deleted file mode 100644 index 71c5656c..00000000 --- a/base.cfg +++ /dev/null @@ -1,57 +0,0 @@ -[buildout] -index = https://pypi.org/simple/ -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg - -show-picked-versions = true -extensions = - mr.developer - -parts = - instance - omelette - releaser - test - code-analysis - -develop = . -package-name = collective.taxonomy -package-extras = [test] - -[instance] -recipe = plone.recipe.zope2instance -user = admin:admin -http-address = 8080 -environment-vars = - zope_i18n_compile_mo_files true -eggs = - Plone - Pillow - collective.taxonomy - Products.PDBDebugMode - pdbpp - -[omelette] -recipe = collective.recipe.omelette -eggs = ${instance:eggs} - -[releaser] -recipe = zc.recipe.egg -eggs = zest.releaser[recommended] - -[versions] -# Don't use a released version of collective.taxonomy -collective.taxonomy = -hurry.filesize = 0.9 -pyjwt = 1.7.1 -# For Buildout related packages, it is easiest to keep them at the same version for all environments. -# Keep these in sync with requirements.txt please: -setuptools = 42.0.2 -wheel = 0.36.2 -zc.buildout = 2.13.4 -# needed for six.ensure_text -six = 1.12.0 - -[versions:python27] -# Last pyrsistent version that is python 2 compatible: -pyrsistent = 0.15.7 diff --git a/buildout.cfg b/buildout.cfg deleted file mode 100644 index 0a1102e0..00000000 --- a/buildout.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[buildout] -extends = test-5.2.x.cfg -parts += - instance \ No newline at end of file diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 00000000..c0e8f2f6 --- /dev/null +++ b/constraints.txt @@ -0,0 +1 @@ +-c https://dist.plone.org/release/6.0-dev/constraints.txt diff --git a/instance.yaml b/instance.yaml new file mode 100644 index 00000000..ee1629ee --- /dev/null +++ b/instance.yaml @@ -0,0 +1,18 @@ +--- +# This is a cookiecutter configuration context file for +# +# cookiecutter-zope-instance +# +# available options are documented at +# https://github.com/bluedynamics/cookiecutter-zope-instance/ +# +# read also README_MAKE.md in this folder +# +default_context: + wsgi_listen: localhost:8080 + initial_user_name: admin + initial_user_password: admin + load_zcml: + package_includes: ['collective.taxonomy'] + db_storage: direct + debug_mode: on diff --git a/mx.ini b/mx.ini new file mode 100644 index 00000000..b7c87f63 --- /dev/null +++ b/mx.ini @@ -0,0 +1,37 @@ +[settings] +# This is a mxdev configuration file +# +# available options are documented at +# https://pypi.org/proejct/mxdev/ +# +# read also README_MAKE.md in this folder +# +requirements-in = requirements.txt +requirements-out = requirements-mxdev.txt + +# ignore own dev-package from existing constraints +# because it is pinned in the plone-release +ignores = + setuptools + pip + wheel + collective.taxonomy + +version-overrides = + robotframework==5.0.1 + robotframework-seleniumtestability==2.0.0 + robotframework-seleniumlibrary==6.0.0 + robotsuite==2.3.1 + selenium==4.2.0 + +default-install-mode = direct + +# variables +; github = git+ssh://git@github.com +github = git+https://github.com + +# Checkouts after ES6 merge +; [mockup] +; url = ${settings:github}/plone/mockup.git +; branch = master +; install-mode = skip diff --git a/requirements.txt b/requirements.txt index 2cc96136..002e6dba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,6 @@ -setuptools==41.3.0 -# setuptools==42.0.2 -zc.buildout==2.13.2 +-c constraints.txt +-e .[test] --install-option="--pre" + +# WSGI: A system for configuration of WSGI web components in declarative .ini format. +Paste +pdbpp diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..e69de29b diff --git a/setup.py b/setup.py index b09eeae6..426fc22f 100644 --- a/setup.py +++ b/setup.py @@ -24,18 +24,16 @@ def read(*pathnames): "Development Status :: 6 - Mature", "Environment :: Web Environment", "Framework :: Plone", - "Framework :: Plone :: 5.0", - "Framework :: Plone :: 5.1", - "Framework :: Plone :: 5.2", + "Framework :: Plone :: 6.0", "Framework :: Plone :: Addon", "Framework :: Zope", - "Framework :: Zope :: 2", - "Framework :: Zope :: 4", + "Framework :: Zope :: 5", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Programming Language :: Python", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], keywords='plone taxonomy dexterity', author='Bo Simonsen and Malthe Borch', diff --git a/test-5.0.x.cfg b/test-5.0.x.cfg deleted file mode 100644 index 0031db8b..00000000 --- a/test-5.0.x.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.0.x.cfg - base.cfg - -[versions] -# Maybe just a problem with 3.3.0 on Maurits' Mac: -Pillow = 3.3.3 -# plone.restapi now requires 'plone.schema>=1.2.1', but Plone 5.0 pins it to 1.1.0. -plone.schema = 1.2.1 diff --git a/test-5.1.x.cfg b/test-5.1.x.cfg deleted file mode 100644 index 5f673624..00000000 --- a/test-5.1.x.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.1.x.cfg - base.cfg - diff --git a/test-5.2.x.cfg b/test-5.2.x.cfg deleted file mode 100644 index 6950a3aa..00000000 --- a/test-5.2.x.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[buildout] -extends = - https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.2.x.cfg - base.cfg diff --git a/tox.ini b/tox.ini deleted file mode 100644 index dd54016e..00000000 --- a/tox.ini +++ /dev/null @@ -1,20 +0,0 @@ -[tox] -minversion = 3.18 -envlist = - plone50-py27 - plone51-py27 - plone52-py{27,36,37,38} - -[testenv] -# We do not install with pip, but with buildout: -usedevelop = false -skip_install = true -passenv=* -deps = - -r requirements.txt -commands_pre = - plone50: {envbindir}/buildout -Nc {toxinidir}/test-5.0.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test - plone51: {envbindir}/buildout -Nc {toxinidir}/test-5.1.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test - plone52: {envbindir}/buildout -Nc {toxinidir}/test-5.2.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test -commands = - {envbindir}/test