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

zcml_package_includes does not add package to site.zcml where deprecated load_zcml: package_includes still works #27

Closed
fredvd opened this issue Sep 20, 2024 · 1 comment
Assignees

Comments

@fredvd
Copy link
Member

fredvd commented Sep 20, 2024

Something strange is going on with the new format to add package includes. I found out about this when trying to add experimental.gracefulblobmissing to a setup:

This is deprecated in the instance.yaml

load_zcml:
    package_includes: ['mysite_policy', 'experimental.gracefulblobmissing']

It throws a warning, but stil adds both package to the ./instance/etc/site.zcml

The new format:

zcml_package_includes: ['mysite_policy', 'experimental.gracefulblobmissing']

Does not add experimental.gracefulblobmissing to the site.zcml. But that this parameter is no longer working is probably missed by many, because they also have

[settings]
main-package = -e src/mysite_policy[test]

in their mx.ini, and this registration add the zcml for the main package also to the site.zcml:

  <!-- INCLUDES mysite_policy -->
  <include package="mysite_policy" />

I have another issue open with this template where the db_blob(s)_location rename deprecation is not working, #25. Is something more in general wrong with the deprecation code in cookiecutter or this template?

@jensens
Copy link
Member

jensens commented Sep 24, 2024

The docs:

zcml_package_includes

    A string with comma separated configure.zcml files from packages to include.

    Examples: "my.fancypackage" or "myns.mypackage, collective.example"

    Default: empty string

You wrote it as a list:

zcml_package_includes: ['mysite_policy', 'experimental.gracefulblobmissing']

but correct is
zcml_package_includes: mysite_policy, experimental.gracefulblobmissing

Why? Because otherwise it is not possible to override this value with environment variables, like in this script https://github.com/plone/cookiecutter-zope-instance/blob/main/helpers/transform_from_environment.py

@jensens jensens closed this as completed Sep 24, 2024
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

No branches or pull requests

5 participants