Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[run]
source = src/collective/js/tooltipster

[report]
include =
src/collective/*
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# 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-24.04
strategy:
fail-fast: false
matrix:
include:
# - python: 2.7.18
# plone: 4.3
# - python: 3.7.14
# plone: 5.2
- python: 3.10.11
plone: "6.0"
- python: 3.13.1
plone: "6.1"
- python: 3.13.1
plone: "6.2"
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: Cache eggs restore
# id: cache-restore
# uses: actions/cache/restore@v3
# 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: Cache eggs save
# uses: actions/cache/save@v3
# with:
# path: ~/buildout-cache/eggs
# key: ${{ steps.cache-restore.outputs.cache-primary-key }}
- name: test
run: |
bin/test -t !robot
coverage:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- python: 3.13.1
plone: "6.2"
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.settings/
bin/
buildout-cache/
CACHEDIR.TAG
develop-eggs/
parts/
src/*
Expand All @@ -19,6 +20,9 @@ htmlcov/
output.xml
*.swp
lib/
.plone-version
.python-version
pyvenv.cfg
include/
temp_auto_push.bat
temp_interactive_push.bat
Expand Down
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

22 changes: 17 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@ Changelog
=========


1.9 (unreleased)
----------------

- Nothing changed yet.

2.0.0 (unreleased)
------------------

- Migrated to Plone 6.2 / Python 3, based on the work started on `plone61`
by @chris-adam and @laulaz.
[laulaz, chris-adam]
- Added Plone 6.1 version in buildout.
[chris-adam]
- Plone 6.2 support. Removed the Plone 4 `themes` profile and upgrade step
(themes are bundles of the default profile).
[chris-adam]
- `tooltipster_helper`: `view_content_selector` moved into `options` (the 3rd
positional parameter is `data_parameters` again, as callers expect), and the
view is called on the context URL (`data-base-url`) when there is no `data-base_url`.
[chris-adam]
- `tooltipster_helper`: send `ajax_load=1` (Plone 6 rendered the whole page for a timestamp).
[chris-adam]

1.8 (2024-02-08)
----------------
Expand Down
112 changes: 112 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/usr/bin/make
# pyenv is a requirement, with 3.13 python versions, and virtualenv installed in each version
# plone parameter must be passed to create environment 'make setup plone=6.0' or after a make cleanall
# The original Makefile can be found on https://github.com/IMIO/scripts-buildout

SHELL=/bin/bash
plones=6.0 6.1 6.2
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),6.0)
python=3.10
endif
ifeq ($(plone),6.1)
python=3.13
endif
ifeq ($(plone),6.2)
python=3.13
endif
endif

all: buildout

.PHONY: help
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)

.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

.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: robot
robot: oneof-plone bin/buildout ## run robot tests in headless firefox
# opt -t filters are ORed with -t robot: run one scenario with MOZ_HEADLESS=1 bin/test --all -t "loaded once"
MOZ_HEADLESS=1 bin/test --all -t robot ${opt}

.PHONY: robot-server
robot-server: ## Starts robot server (layer=<layer name in testing.py>, default COLLECTIVE_JS_TOOLTIPSTER_ACCEPTANCE_TESTING)
# run a robot file against it with: bin/robot -v PLONE_MAJOR:$(firstword $(subst ., ,$(plone))) src/collective/js/tooltipster/tests/robot/test_tooltipster.robot
# (no isolation between tests there: every test creates the same "doc", run one test at a time with -t)
# --no-reload: the reload watchdog restarts the server when a template is read
env ZSERVER_HOST=localhost ZSERVER_PORT=$(or $(ZSERVER_PORT),55001) bin/robot-server --no-reload -v collective.js.tooltipster.testing.$(or $(layer),COLLECTIVE_JS_TOOLTIPSTER_ACCEPTANCE_TESTING)

.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
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ Version 4.2.6
Themes
******

If you want to use additional themes, just import profile "collective.js.tooltipster Themes" in portal_setup.

Following themes are available :
The default profile also installs the theme stylesheets (one bundle each):

- tooltipster-borderless
- tooltipster-light
- tooltipster-noir
- tooltipster-punk
Expand Down
18 changes: 5 additions & 13 deletions buildout.cfg → base.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[buildout]
extends = http://dist.plone.org/release/4.3-latest/versions.cfg
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
extensions = mr.developer
parts =
parts +=
instance
test
robot
develop = .


Expand Down Expand Up @@ -40,15 +42,5 @@ defaults = ['-s', 'collective.js.tooltipster', '--auto-color', '--auto-progress'
recipe = zc.recipe.egg
eggs =
${test:eggs}
plone.app.robotframework[debug,ride,reload]
plone.app.robotframework[debug,reload]


[versions]
zc.buildout = 2.10.0
zc.recipe.egg = 2.0.1

robotframework = 2.8.4
robotframework-ride = 1.3
robotframework-selenium2library = 1.6.0
robotsuite = 1.6.1
selenium = 2.44.0
30 changes: 5 additions & 25 deletions bootstrap-buildout.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,10 @@
"even if they are alphas or betas."
),
)
parser.add_option("-c", "--config-file", help=("Specify the path to the buildout configuration " "file to be used."))
parser.add_option("-f", "--find-links", help=("Specify a URL to search for buildout releases"))
parser.add_option(
"-c",
"--config-file",
help=("Specify the path to the buildout configuration " "file to be used."),
)
parser.add_option(
"-f", "--find-links", help=("Specify a URL to search for buildout releases")
)
parser.add_option(
"--allow-site-packages",
action="store_true",
default=False,
help=("Let bootstrap.py use existing site packages"),
"--allow-site-packages", action="store_true", default=False, help=("Let bootstrap.py use existing site packages")
)
parser.add_option("--setuptools-version", help="use a specific setuptools version")

Expand Down Expand Up @@ -124,22 +115,11 @@

ws = pkg_resources.working_set

cmd = [
sys.executable,
"-c",
"from setuptools.command.easy_install import main; main()",
"-mZqNxd",
tmpeggs,
]
cmd = [sys.executable, "-c", "from setuptools.command.easy_install import main; main()", "-mZqNxd", tmpeggs]

find_links = os.environ.get(
"bootstrap-testing-find-links",
options.find_links
or (
"http://downloads.buildout.org/"
if options.accept_buildout_test_releases
else None
),
options.find_links or ("http://downloads.buildout.org/" if options.accept_buildout_test_releases else None),
)
if find_links:
cmd.extend(["-f", find_links])
Expand Down
4 changes: 4 additions & 0 deletions gha.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[buildout]
extends =
test.cfg
eggs-directory = ~/buildout-cache/eggs
3 changes: 3 additions & 0 deletions requirements-6.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-c https://dist.plone.org/release/6.0-latest/requirements.txt
setuptools
zc.buildout
3 changes: 3 additions & 0 deletions requirements-6.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-c https://dist.plone.org/release/6.1-latest/requirements.txt
setuptools
zc.buildout
Loading
Loading