Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3 in Plone 5.2 and 6 #12

Merged
merged 38 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
20600df
add tests for 5.1 and 5.2
djay Nov 21, 2019
2b316b9
fix buildouts
djay Nov 21, 2019
9900bf5
fix buildout
djay Nov 21, 2019
c519c21
try to get robot tests working
djay Nov 22, 2019
71f0497
fix python version matrix
djay Nov 22, 2019
cc63408
fix robot tests
djay Nov 22, 2019
a75bf5b
fix matrix
djay Nov 22, 2019
3565bf5
try to fix configparser build issue
djay Nov 22, 2019
58c298f
fix relative imports
djay Nov 22, 2019
5763552
add support for python3
pbauer Feb 14, 2022
4280dd1
workon fixing tests for Plone 6
pbauer Apr 4, 2022
f7a60f2
modernize profiles, add browserlayer (for overrides)
pbauer Apr 4, 2022
7ad9b8a
add copy of Products/CMFPlone/browser/login/templates/pwreset_form.pt…
pbauer Apr 4, 2022
3eff070
Override pwreset_+form (of Plone 6) to display requirements.
pbauer Apr 4, 2022
bfb95bb
unify robot-tests and fix them for Plone 6
pbauer Apr 4, 2022
da0072f
drop support for plone 5.1 and older
pbauer Apr 4, 2022
794d42f
try to setup gihub-actions
pbauer Apr 4, 2022
d1cd92b
update readme, changelog and version
pbauer Apr 4, 2022
327ac64
cleanup
pbauer Apr 4, 2022
d9a59fb
fix filename
pbauer Apr 4, 2022
a73906c
workon gh actions
pbauer Apr 4, 2022
8ae1b3b
no chrome
pbauer Apr 4, 2022
88b68d7
looking for a WebDriver
pbauer Apr 4, 2022
5d92e53
debug
pbauer Apr 4, 2022
ee663c8
more
pbauer Apr 4, 2022
3cbfe4c
meh
pbauer Apr 4, 2022
be8dc5b
mehmeh
pbauer Apr 4, 2022
f8630ca
once more
pbauer Apr 4, 2022
4273f94
once more without tox
pbauer Apr 5, 2022
08bf9e0
no layers
pbauer Apr 5, 2022
31b6167
now this
pbauer Apr 5, 2022
ce24f1e
gnnnn
pbauer Apr 5, 2022
78d5e10
debug
pbauer Apr 5, 2022
b295764
more
pbauer Apr 5, 2022
7d4e789
Include fix by ivanteoh from master branch
pbauer Apr 7, 2022
76fa5bf
add changenote
pbauer Apr 7, 2022
ef7ee97
include pt files in dist
pbauer Apr 25, 2022
051302d
Merge branch 'master' into python3
pbauer Sep 25, 2024
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
99 changes: 68 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,79 @@ name: tests

on:
push:
branches: [ main ]
branches: [ master, python3 ]
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
# [Python version, tox env]
- ["2.7", "plone52-py27"]
- ["3.6", "plone52-py36"]
- ["3.7", "plone52-py37"]
- ["3.8", "plone52-py38"]
- ["3.7", "plone60-py37"]
- ["3.8", "plone60-py38"]
- ["3.9", "plone60-py39"]
runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
plone-version:
# - '5.2'
- '6.0'
python-version:
# - '2.7'
# - '3.7'
# - '3.8'
- '3.9'
# exclude:
# - plone-version: '5.2'
# python-version: '3.9'
# - plone-version: '6.0'
# python-version: '2.7'
steps:
- uses: actions/checkout@v2
- 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@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y libxml2-dev libxslt-dev python-dev xvfb
pip install virtualenv wheel
- uses: nanasess/setup-chromedriver@master
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/buildout-cache
~/extends
~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.plone-version }}-${{ hashFiles('**/*.cfg') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.plone-version }}-
${{ runner.os }}-${{ matrix.python-version }}-
${{ runner.os }}-
- name: setup buildout cache
run: |
mkdir -p ~/buildout-cache/{eggs,downloads}
mkdir ~/.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
- name: bootstrap buildout py2
if: ${{ matrix.python-version == '2.7'}}
run: |
virtualenv .
bin/pip install -r requirements.txt
- name: bootstrap buildout py3
if: ${{ matrix.python-version != '2.7'}}
run: |
python -m venv .
bin/pip install -r requirements.txt
- name: buildout
run: |
bin/buildout -t 10 -Nc test-${{ matrix.plone-version }}.x.cfg
bin/pip install zest.pocompile
bin/pocompile src
- name: test
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
sleep 2
PATH=$PATH:$PWD/chromedriver ROBOT_BROWSER=chrome ROBOT_HTTP_PORT=55001 bin/test
cat /home/runner/work/Products.PasswordStrength/Products.PasswordStrength/parts/test/password/Test_register_form/output.xml
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Changes
=======

0.4.1 (unreleased)
0.5.0 (unreleased)
------------------

- Add support for Python 3, Plone 5.2 and Plone 6. Drop support for Plone 5.1 and older.
[pbauer, djay]

- Fix can not change weak password
[ivanteoh]

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include *.txt *.rst
recursive-include Products *.zcml *.xml *.txt
recursive-include Products *.cpt *.metadata *.zpt
recursive-include Products *.cpt *.metadata *.zpt *.pt
recursive-include Products *.po *.pot
recursive-include Products *.robot
exclude bootstrap.py *.cfg *.yml
Expand Down
2 changes: 1 addition & 1 deletion Products/PasswordStrength/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from Products.PluggableAuthService import registerMultiPlugin
from zope.i18nmessageid import MessageFactory
_ = MessageFactory("Products.PasswordStrength")
from plugin import PasswordStrength, manage_addPasswordStrength, manage_addPasswordStrengthForm
from Products.PasswordStrength.plugin import PasswordStrength, manage_addPasswordStrength, manage_addPasswordStrengthForm


def initialize(context):
Expand Down
69 changes: 0 additions & 69 deletions Products/PasswordStrength/backward.py

This file was deleted.

55 changes: 8 additions & 47 deletions Products/PasswordStrength/configure.zcml
Original file line number Diff line number Diff line change
@@ -1,61 +1,22 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:cmf="http://namespaces.zope.org/cmf"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:monkey="http://namespaces.plone.org/monkey"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="Products.PasswordStrength">

<!-- <five:registerPackage package="." initialize=".initialize" /> -->
<include package="collective.monkeypatcher" file="meta.zcml" />
<include file="profiles.zcml" />
<include file="skins.zcml" />
<include file="profiles.zcml" />

<monkey:patch
preconditions="Products.CMFPlone-=4.2.99"
description="Change password description schema"
class="plone.app.users.browser.register.BaseRegistrationForm"
original="update"
replacement=".backward.updateRegistrationForm"
docstringWarning="true"
ignoreOriginal="true"
<include package="z3c.jbot" file="meta.zcml" />
<browser:jbot
directory="overrides"
layer="Products.PasswordStrength.interfaces.IPasswordStrengthLayer"
/>


<!--<configure zcml:condition="have plone-4" />-->
<!--<monkey:patch-->
<!--preconditions="Products.CMFPlone-=4.2.99"-->
<!--description="Change password description schema"-->
<!--class="plone.app.users.browser.personalpreferences.PasswordAccountPanel"-->
<!--original="update"-->
<!--replacement=".backward.updatePasswordAccountPanel"-->
<!--docstringWarning="true"-->
<!--ignoreOriginal="true"-->
<!--/>-->
<!--</configure>-->

<!--<monkey:patch-->
<!--preconditions="Products.CMFPlone+=5.0"-->
<!--description="Change password description schema"-->
<!--class="plone.app.users.browser.passwordpanel.PasswordPanel"-->
<!--original="update"-->
<!--replacement=".backward.updatePasswordAccountPanel"-->
<!--docstringWarning="true"-->
<!--ignoreOriginal="true"-->
<!--/>-->

<monkey:patch
preconditions="Products.CMFPlone-=4.2.99"
description="Use pas plugin in validation"
class="Products.CMFPlone.RegistrationTool.RegistrationTool"
original="testPasswordValidity"
replacement=".backward.testPasswordValidity"
docstringWarning="true"
/>
<include package="collective.monkeypatcher" file="meta.zcml" />

<monkey:patch
preconditions="Products.CMFPlone+=4.3"
description="Skip password validity for generated passwords"
class="Products.CMFPlone.RegistrationTool.RegistrationTool"
original="testPasswordValidity"
Expand All @@ -71,6 +32,6 @@
docstringWarning="true"
/>

<i18n:registerTranslations directory="locales" />
<i18n:registerTranslations directory="locales" />

</configure>
7 changes: 7 additions & 0 deletions Products/PasswordStrength/interfaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Module where all interfaces, events and exceptions live."""

from zope.publisher.interfaces.browser import IDefaultBrowserLayer


class IPasswordStrengthLayer(IDefaultBrowserLayer):
"""Marker interface that defines a browser layer."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
msgid ""
msgstr ""
"Project-Id-Version: Products.PasswordStrength\n"
"POT-Creation-Date: 2015-07-03 13:29+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: Steffen Lindner <[email protected]\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: de\n"
"Language-Name: Germany\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: Products.PasswordStrength\n"

#. Default: "Add"
#: ../www/passwordStrengthAdd.zpt:37
msgid " Add "
msgstr " Hinzufügen "

#: ../www/passwordStrengthAdd.zpt:6
msgid "A plugin that rejects passwords that don't conform to a certain strength"
msgstr "Ein Plugin welches keine unsichere Passwörter zulässt."

#: ../plugin.py:31
msgid "Create your own rules for enforcing password strength"
msgstr "Erstelle deine eigenen Passwort regeln"

#: ../plugin.py:79
msgid "Minimum 1 capital letter"
msgstr "Mindestens ein Grossbuchstabe"

#: ../plugin.py:80
msgid "Minimum 1 lower case letter"
msgstr "Mindestens ein Kleinbuchstabe"

#: ../plugin.py:82
msgid "Minimum 1 non-alpha character"
msgstr "Mindestens ein Sonderzeichen"

#: ../plugin.py:81
msgid "Minimum 1 number"
msgstr "Mindestens eine Nummer"

#: ../plugin.py:80
msgid "Minimum 10 characters"
msgstr "Mindestens 10 Zeichen"

#. Default: "PAS plugin that ensures strong passwords."
#: ../configure.zcml
msgid "PAS plugin that ensures strong passwords."
msgstr "Module PAS proposant une politique forte des mots de passes"

#. Default: "Password Strength Plugin"
#: ../configure.zcml
msgid "Password Strength Plugin"
msgstr "Module Password Strength"

#: ../plugin.py:207
msgid "This password doesn't match requirements for passwords"
msgstr "Dieses Passwort entspricht nicht den Passwort Vorgaben"

#: ./backward.py:20
msgid "You must enter a password"
msgstr "Sie müssen ein Passwort eingeben"

#: ./backward.py:17
msgid "Your password and confirmation did not match. Please try again."
msgstr "Dein Passwort und deine Bestätigung stimmen nicht überein. Bitte versuch es nochmal."

Loading
Loading