Skip to content

Conversation

@MrTango
Copy link
Contributor

@MrTango MrTango commented Feb 11, 2025

First-time contributors

You must read and follow our First-time contributors.


Submit a pull request

Thank you for your contribution to the Plone Documentation.

Before submitting this pull request, please make sure you follow our guides:

Issue number

  • Fixes #

Description

Write a description of the fixes or improvements.

Add screenshots or links to a preview of the changes


📚 Documentation preview 📚:

MrTango and others added 3 commits February 12, 2025 11:39
@jensens jensens force-pushed the chapter-deprecation branch from 2ccbcf2 to 46b14eb Compare December 4, 2025 23:58
@jensens
Copy link
Member

jensens commented Dec 5, 2025

Ok, this should work. @stevepiercy what do you think?

ale-rt
ale-rt previously approved these changes Dec 5, 2025
Copy link
Member

@ale-rt ale-rt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much to all of you :)
@stevepiercy do you mind having another look?

- Generalize for npm and Volto
- Clean up MyST style and formatting
- Clean up grammar, MyST syntax
- Indent code within list items.
- Use ruff style code example formatting.
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good. I can tell because even I can understand it.

I have only one question that needs to be addressed. Thank you!

@jensens
Copy link
Member

jensens commented Dec 15, 2025

This is really good. I can tell because even I can understand it.

I have only one question that needs to be addressed. Thank you!

sorry, I can not find the question...


### Zope

Zope configures logging and warnings, so the steps as described below in {ref}`deprecation-warning-python-label` aren't needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the steps in the next section aren't needed, then why do we include them?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With next step you refer to debug-mode on? IIRC it is needed to show the messages. I wrote this down years ago, so this may have been subject to change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And with cookiecutter-zope-instance based installs we only need to use the PYTHONWARNINGS variable or start the interpreter with parameters (like below in Python).

Thinking further, I am not 100% sure if the above method is anyway ZServer only?
Does anybody in here know more details?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jensens you might be able to see it more clearly on the pull request preview, beginning at https://plone6--1850.org.readthedocs.build/developer-guide/deprecation.html#zope.

This sentence refers to the next section entitled Python, and it states that the steps in that section are not needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop the whole section Zope with plone.recipe.zopeinstance since this feature was dropped with WSGI server usage. So, it does not make sense to keep the Python subheading, right?
See last bullet point at https://github.com/plone/plone.recipe.zope2instance/blob/0452e05386708564b17ae1de1aafe708a4d88ccb/CHANGES.rst#610-2018-12-28

Shall we mention somehow this change in the developer guide or focus on the current state?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I could offer advice, but this was before my time. I'll go with what you think is true and accurate, and to the best of your knowledge. We can also wait a few days for other old timers to offer advice. The only thing I can refer to is this search result:

https://6.docs.plone.org/search.html?q=plone.recipe.zopeinstance

I'd focus on the current state of Plone 6.x.x. I'd use a {versionchanged} or {versionremoved} MyST directive, but we should use Plone 6.x.x or 5.x.x as the referred version, whenever the package got released with Plone, not the package's version. The content of that directive should include whatever is helpful to Plone 6 developers for what has changed. There might even be some references in the Upgrade Guide. Why, yes, there is: https://6.docs.plone.org/backend/upgrading/version-specific-migration/upgrade-to-52.html#wsgi

Does that help at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop the whole section Zope with plone.recipe.zopeinstance since this feature was dropped with WSGI server usage. So, it does not make sense to keep the Python subheading, right?

I think you mean we don't need to keep the Zope subheading. The Python subheading still seems accurate.

I must say I always get deprecation warnings when starting Plone though, even though I don't think I have configured anything to enable it. So when I don't want them, I explicitly disable them with export PYTHONWARNINGS=ignore. This may depend on how Python is installed, and with which flags it was built.

Shall we mention somehow this change in the developer guide or focus on the current state?

Indeed focus on current state, but if possible mention the change as Steve says.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We then have one subheading, that is a bit pointless. But if it helps, ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There would be two, one for Python and the other for running tests.

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jensens I thought I had submitted it. Here ya go!

Copy link
Member

@mauritsvanrees mauritsvanrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. I added some suggestions.


### Zope

Zope configures logging and warnings, so the steps as described below in {ref}`deprecation-warning-python-label` aren't needed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop the whole section Zope with plone.recipe.zopeinstance since this feature was dropped with WSGI server usage. So, it does not make sense to keep the Python subheading, right?

I think you mean we don't need to keep the Zope subheading. The Python subheading still seems accurate.

I must say I always get deprecation warnings when starting Plone though, even though I don't think I have configured anything to enable it. So when I don't want them, I explicitly disable them with export PYTHONWARNINGS=ignore. This may depend on how Python is installed, and with which flags it was built.

Shall we mention somehow this change in the developer guide or focus on the current state?

Indeed focus on current state, but if possible mention the change as Steve says.

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor tweaks and the removal of the Zope section and revision of the parent heading content.


To enable deprecation warnings, use the `-W` command.

Given you're using a modern buildout with a virtual environment as recommended, the command would be the following
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Given you're using a modern buildout with a virtual environment as recommended, the command would be the following
Given you're using a modern buildout with a virtual environment as recommended, the command would be the following.


: Warnings are written to `stderr` by default, but `DeprecationWarning` output is surpressed by default.

Output can be enabled by starting the Python interpreter with the {ref}`-W[all|module|once] <python:using-on-warnings>` argument.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Output can be enabled by starting the Python interpreter with the {ref}`-W[all|module|once] <python:using-on-warnings>` argument.
Output can be enabled by starting the Python interpreter with the {ref}`-W[all|module|once] <python:using-on-warnings>` argument.


## Enable deprecation warnings

This section describes how to enable deprecation warnings in Zope, Python, and tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This section describes how to enable deprecation warnings in Zope, Python, and tests.
This section describes how to enable deprecation warnings in Python, both in an interpreter and code, and when running tests.


### Zope

Zope configures logging and warnings, so the steps as described below in {ref}`deprecation-warning-python-label` aren't needed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There would be two, one for Python and the other for running tests.

Comment on lines +26 to +57
### Zope

Zope configures logging and warnings, so the steps as described below in {ref}`deprecation-warning-python-label` aren't needed.

Using `plone.recipe.zope2instance`, add the option `deprecation-warnings = on` to the buildout's `[instance]` section.

```cfg
[buildout]
parts = instance

[instance]
recipe = plone.recipe.zope2instance
# …
deprecation-warnings = on
# …
```

This adds the following line to the {file}`zope.conf` file.

```cfg
debug-mode on
```

Without the recipe, this can be set manually as well.
In {file}`zope.conf`, define custom filters for warnings, such as the following example.

```xml
<warnfilter>
action always
category exceptions.DeprecationWarning
</warnfilter>
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @mauritsvanrees's suggestion.

Suggested change
### Zope
Zope configures logging and warnings, so the steps as described below in {ref}`deprecation-warning-python-label` aren't needed.
Using `plone.recipe.zope2instance`, add the option `deprecation-warnings = on` to the buildout's `[instance]` section.
```cfg
[buildout]
parts = instance
[instance]
recipe = plone.recipe.zope2instance
#
deprecation-warnings = on
#
```
This adds the following line to the {file}`zope.conf` file.
```cfg
debug-mode on
```
Without the recipe, this can be set manually as well.
In {file}`zope.conf`, define custom filters for warnings, such as the following example.
```xml
<warnfilter>
action always
category exceptions.DeprecationWarning
</warnfilter>
```

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

Labels

None yet

Projects

Status: in progress
Status: In Progress

Development

Successfully merging this pull request may close these issues.

7 participants