Skip to content

Plone 6 + py3 only, Makefile, GH Actions#113

Merged
jensens merged 78 commits into
mainfrom
p6
May 4, 2026
Merged

Plone 6 + py3 only, Makefile, GH Actions#113
jensens merged 78 commits into
mainfrom
p6

Conversation

@jensens
Copy link
Copy Markdown
Member

@jensens jensens commented Feb 9, 2022

No description provided.

@jensens
Copy link
Copy Markdown
Member Author

jensens commented Jun 14, 2023

Test setup is broken: Testrunner and LDAP (slapd) not found.
@rnixx I think I need some hints how to configure it.

@mauritsvanrees
Copy link
Copy Markdown
Member

I have done a few minor fixes on the p6 branch.

Two problems remain, as @jensens already mentioned: no tests found and slapd not found.

When you run make test, it executes .mxmake/files/run-tests.sh pas.plugins.ldap. This boils down to venv/bin/zope-testrunner --module=pas.plugins.ldap, and this finds zero tests. So the test runner does not find any tests. The pas.plugins.ldap package is installed though, in editable mode.

What works for me instead: venv/bin/zope-testrunner --path src. I don't know where to fix this though: I don't know how the run-tests.sh file is created.

If we fix that, the second problem is that slapd is not found:

$ venv/bin/zope-testrunner --path src 
Running pas.plugins.ldap.testing.PASLDAPLayer tests:
  Set up node.ext.ldap.testing.SlapdConf /tmp/tmp59y4prjm
SlapdConf set up.
in 0.000 seconds.
  Set up node.ext.ldap.testing.Slapd 
Starting LDAP server: 
slapd -f /tmp/tmp59y4prjm/slapd.conf -h ldap://127.0.0.1:12345 -d 0
Traceback (most recent call last):
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 464, in run_layer
    setup_layer(options, layer, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 829, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 829, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 829, in setup_layer
    setup_layer(options, base, setup_layers)
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/venv/lib/python3.11/site-packages/zope/testrunner/runner.py", line 834, in setup_layer
    layer.setUp()
  File "/var/zope/kennis6-9350/checkouts/pas.plugins.ldap/sources/node.ext.ldap/src/node/ext/ldap/testing/__init__.py", line 172, in setUp
    self.slapd = subprocess.Popen(cmd)
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'slapd'

I did run make install first, and this creates an slapd command in ./openldap/servers/slapd/. When I add this directory to the path and run the tests, slapd can start, but then we are missing ldapadd. This is in ./openldap/bin/. So I add this to the PATH as well, and... success!

$ venv/bin/zope-testrunner --path src
...
Total: 28 tests, 0 failures, 0 errors and 0 skipped in 1.948 seconds.

This is with Python 3.11 on Ubuntu 22.04.

@jensens @rnixx Does this give you enough hints to pick this up again?

@mauritsvanrees
Copy link
Copy Markdown
Member

In other news, the p6 branch seems to work fine in practice for one client that we are testing it for, and where previous versions run fine on Plone 4.3 and 5.2.

Using these versions next to an internal release of p6:

bda.cache = 1.3.0
five.globalrequest = 99.1
node = 1.2.1
node.ext.ldap = 1.2
node.ext.ugm = 1.1
odict = 1.9.0
passlib = 1.7.4
pyasn1 = 0.5.1
pyasn1-modules = 0.3.0
python-ldap = 3.4.4
python-memcached = 1.59
yafowil = 3.1.0
yafowil.bootstrap = 2.0.0a1
yafowil.plone = 5.0.0a1
yafowil.widget.array = 2.0a1
yafowil.widget.dict = 2.0a1
yafowil.yaml = 2.0

I don't think we are using groups from LDAP in this site. But authentication works, and search works.

Control panel could be a bit better: fieldsets are not shown in tabs, but simply everything below each other. But that is a minor point for me.

jensens added 2 commits April 27, 2026 11:07
…d load_zcml

- Regenerate Makefile with `uvx mxmake update` (mxmake 2.2.0). New Makefile
  fixes the mxdev offline-mode error in CI: SOURCES_TARGET now runs online
  to populate `.mxdev_cache` before FILES_TARGET reads it offline.
- Workflow: pass `PRIMARY_PYTHON=\${{ matrix.python }}` to make so the matrix
  Python is actually used. The previous `VENV=off` had no effect (the
  variable is `VENV_ENABLED`), so uv created the venv with system Python 3.12
  regardless of the matrix value.
- instance.yaml: replace deprecated `load_zcml: {package_includes: [...]}`
  with `zcml_package_includes: [...]` (cookiecutter-zope-instance >=2.0).
- .gitignore: ignore generated `/.mxdev_cache/`.
`ldaptesting.props` (upstream node.ext.ldap LDAPProps) has no `roles`
attribute, so reading it raised AttributeError. Inside the `_ldap_props`
property getter this gets re-wrapped by Python as
`AttributeError: _ldap_props`, which cascaded to the 25 test failures.

Hardcode the test fixture to `["Member"]` (the same value as
`DEFAULTS["server.roles"]`).
@jensens
Copy link
Copy Markdown
Member Author

jensens commented Apr 27, 2026

@macagua I fixed the branch - what is missing are some basic manual tests if everything is working fine in a real Plone site with user and groups and if the ZMI UI works.

@macagua
Copy link
Copy Markdown
Member

macagua commented Apr 27, 2026

@szakitibi Thanks to @jensens's work, this branch is now up to date with the main branch, we just need to way for the merge to main branch.

@jensens, is there something can I help you? in addition to testing your changes in the p6 branch

@macagua

Hi @jensens I would like to continue this job, Can you tell me what tasks are pending to help you to finish your work?

@jensens said here:

It needs a rebase of main (conflicts expected, mostly to take stuff from p6 branch I guess) and then it is ready for merge and a 2.0 release.

I think that is still relevant, p6 is 38 commit behind currently and can't automatically merge.

@macagua
Copy link
Copy Markdown
Member

macagua commented Apr 27, 2026

@macagua I fixed the branch - what is missing are some basic manual tests if everything is working fine in a real Plone site with user and groups and if the ZMI UI works.

@jensens Great to read this, let me try and test these stuff.

@macagua
Copy link
Copy Markdown
Member

macagua commented May 2, 2026

@jensens, I added more improvements about UX for the Plone Control Panel, it looks like the following screenshot:

screenshot-localhost_8080-2026 05 02-20_19_20

I’ve split the entire form into four tabs, much like the Plone Classic UI.


I added full unit test support for this add-on

======================================================================================== 238 passed, 5 warnings in 4.03s ========================================================================================
Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
src/pas/plugins/ldap/__init__.py                        16      0   100%
src/pas/plugins/ldap/cache.py                          111      0   100%
src/pas/plugins/ldap/defaults.py                         2      0   100%
src/pas/plugins/ldap/interfaces.py                       8      0   100%
src/pas/plugins/ldap/monkey.py                          63      0   100%
src/pas/plugins/ldap/plonecontrolpanel/__init__.py       9      0   100%
src/pas/plugins/ldap/plonecontrolpanel/cache.py         22      0   100%
src/pas/plugins/ldap/plugin.py                         357      0   100%
src/pas/plugins/ldap/properties.py                     285      0   100%
src/pas/plugins/ldap/setuphandlers.py                   29      0   100%
src/pas/plugins/ldap/sheet.py                           57      0   100%
------------------------------------------------------------------------
TOTAL                                                  959      0   100%

Also I updated the README file for the general documentation.

@jensens
Copy link
Copy Markdown
Member Author

jensens commented May 4, 2026

@macagua This is awesome! I merge it now, but I do not have time today for a release.

@jensens jensens merged commit a305ff0 into main May 4, 2026
7 checks passed
@jensens jensens deleted the p6 branch May 4, 2026 13:05
@szakitibi
Copy link
Copy Markdown

... I merge it now, but I do not have time today for a release.

According to https://pypi.org/project/pas.plugins.ldap/#history no release has been created since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants