megrok.strictrequire
What is megrok.strictrequire?
Strictrequire implements additional grokkers for the various view components in Grok. These grokkers determine whether the grok.require directive has been explicitly set on the view component (or on its baseclass).
It will raise an error (and thus prevent the startup of the application) if there’s a view component without an explicit use of the grok.require directive, providing a minimal safety net for finding unprotected views in your application.
Making use of megrok.strictrequire
To enable megrok.strictrequire simply list it as a requirement in your projects’s setup.py. Grok based applications that were bootstrapped with a recent version of the grokproject command will automatically include the megrok.strictrequire’s configure.zcml making the additional grokkers effective.
Caveat
If your applications triggers the registration of “third-party” views that do not themselves specifically use the grok.require directive, your application will not start.
If you decide you still want to make use of the third-aprty views you should make sure the inclusion of the configure.zcml of megrok.strictrequire comes after the inclusion of the third-party package by tweaking your applications’s configure.zcml. For example:
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:grok="http://namespaces.zope.org/grok">
<include package="grok" />
<!-- include this package before mgrok.strictrequire is included -->
<include package="package_with_unprotected_views" />
<!-- includeDependencies will include megrok.strictrequire -->
<includeDependencies package="." />
<grok:grok package="." />
</configure>
Changelog of megrok.strictrequire
5.2 (2026-01-22)
Move package metadata from setup.py to pyproject.toml.
Add support for Python 3.14.
Drop support for Python 3.9.
5.1 (2025-02-14)
Fix how PEP 420 namespace is used in setup.py.
Add support for Python 3.13.
Drop support for Python 3.7, 3.8.
5.0 (2024-03-22)
Drop support for explicit (pkg_resources) namespaces and replace it with an implicit (PEP 420) namespace.
4.0 (2024-01-25)
Drop support for Python 2.7, 3.4, 3.5, 3.6.
Drop support for grok < 5, thus dropping support for JSON, REST and XMLRPC.
Add support for Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12.
3.0.0 (2018-01-17)
Python 3 compatibility.
0.7 (2018-01-10)
Dependencies update in preparation of Python2/3 migration.
0.6 (2013-10-16)
Add grokker for grok.Page components.
0.5 (2011-07-19)
Reflect recent changes in grok 1.8.
0.4 (2011-07-11)
Use the groktoolkit versions.
Don’t check the requirement directive for ViewletManager, as these are not exposed as views.
0.3 (2010-05-18)
Test-requirements have been fixed. They formally include zope.app.testing for the moment.
0.2 (2009-06-22)
Check ViewletManager and Viewlet components too.
0.1 (2009-06-18)
Initial release.
Release files for megrok.strictrequire 5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| megrok_strictrequire-5.2.tar.gz | 10.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| megrok_strictrequire-5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.1 kB
Release files / megrok_strictrequire-5.2.tar.gz
| Download URL | megrok_strictrequire-5.2.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46cf28b29d56930ddf40912a6d8716619afccaf942183995ea9093126391dd11
|
|
BLAKE2b-256 checksum How to use checksums |
7fb8a08ec2c8040de3b455c336a0cb53dea19ab190e812aedde79e0f924b69ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.12
|
Release files / megrok_strictrequire-5.2-py3-none-any.whl
| Download URL | megrok_strictrequire-5.2-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4e3012b238d32be0e73459d5925f763f4f93d0290ca4b8507bd92f921254f28
|
|
BLAKE2b-256 checksum How to use checksums |
873ad912ae3883cea634617debda24f9853873c26b8fc02a7e293e7e7a2e672e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.12
|