Open Carreau opened 1 year ago
It is an useful information to me. Why do you want to remove it?
for say 3.6-3.12 I find it useful, but I find it adds cruft in some area.
For example:
Changed in version 3.4: Test discovery supports [namespace packages](https://docs.python.org/3/glossary.html#term-namespace-package) for the start directory. Note that you need to specify the top level directory too (e.g. python -m unittest discover -s root/namespace -t root).
Couldn't the Note that you need to specify the top level directory too (e.g. python -m unittest discover -s root/namespace -t root).
part be in the normal doc instead of being in a .. version changed::
?
But another
Skipping tests and expected failures
New in version 3.1.
At that point do the "new in version 3.1" really bring useful information as a first item to inform the use in the skipping test and expected failures ?
I don't have a strong opinon about it, I will not block if you propose a change :-)
I'm not concerned by Changelog which goes up to Python 3.5.0! Maybe it's time to cut it :-) https://docs.python.org/dev/whatsnew/changelog.html#python-3-5-0-alpha-1
It was discussed on the core dev Discord fairly recently.
To summarise:
<details>
)The current policy is that the Python x (3) manual should have a complete history of feature changes so that one can write and maintain code compatible with any minor x.y (3.y) version. The premise of this proposal seems to be that is that no one writes or maintains code for 3.5 or earlier. I doubt that this is true for the wider Python community. In any case, I think that this documentation policy change should be discussed on discourse, just as major code changes should be discussed on the Ideas channel. This issue could be closed and reopened later.
Note 1: AFAIK, no notices in the Python 2 manual were ever removed. On the other hand, there were just 8 Python 2 versions over a decade, at which point Python 2 and its manual were essentially feature frozen.
Note 2: When 3.0 came out, it was anticipated that we would be distributing Python 4 now, with a new manual tracking changes from 4.0. (Releasing 3.10 required removing the assumption in several places that 1 digit was enough for the minor version number.) Since that has not happened yet, I think revising the policy can be considered.
Note 3: PyPI searches in a browser do not seem directly useful for ongoing guidance as to what changes to make. Searches https://pypi.org/search/?q=&o=&c=Programming+Language+%3A%3A+Python+%3A%3A+3.0 (and .1, .2, .3) give 647, 1435, 5469, and 10000+ hits (and 10000+ up to 3.11). Dead packages tend to hang around, while we would be more interested in active projects that drop older versions.
I personally don't really mind seeing them at least back to Python 3.0 as they're not that numerous (relative to the size of the docs) or intrusive, and we of course certainly shouldn't spend valuable time mechanically removing semantically meaningful information from the source. Though, I don't feel too strongly about hiding annotations for Python <≈3.4-3.5 or so in the rendered output, if its agreed upon by others.
Whatever minimum version we agree on, 3.0, 3.6 or something in between, it would be trivial to implement this via via a Sphinx post-transform that checks for versionmodified
nodes (of the desired types) that have a version older than that specified by a conf.py
config value and removes them from the output. This could be easily adjusted in the future if our policy were to change, or upon the release of a new version, by changing a single config value.
I've opened a PR, #108522 , with a working implementation, if/when we agree on a minimum value, or we could specify 3.0 for starters as the status quo, and change it later if agreed.
One other point to note is that seeing an annotation for a version well older than anything than I support gives me affirmative confirmation that I can safety use an API, whereas not showing it adds a kernel of doubt that perhaps the annotation was simply omitted (of course, with reasonably complete annotations in the source and a couple additional bits of inline structured data, we avoid the latter concern by programmatically validate that all public APIs have the version they were added documented in their metadata, which is something I'm currently working on).
Thanks, I'll use my best judgement if I see anything that could be written better or maybe remove. I just want to make sure there is no "keep everything" policy.
I just want to make sure there is no "keep everything" policy.
@Carreau To summarize my interpretation of the discussions here and elsewhere, the general consensus seems to be that older .. versionadded
/ .. versionchanged
should generally, aside from special cases, be kept in the source at least, as they provide useful human and machine-readable semantic information, and can easily be hidden from the reader-facing output if desired and agreed upon, as the implementation in #108522 illustrates.
However, you bring up the good point that there are cases where significant information/explanation is contained within the versionchanged rather than in the prose proper and likely should be moved to the latter if it exists already or is still useful, or otherwise considered for removal from the message. Indeed, as @AA-Turner lists in detail on the PR, there seems to be a fair number of cases where this is so.
Therefore, for those it seems it would be of value to move such detailed information to the prose instead, leaving just a brief summary in the versionchanged
, which is also a blocker to considering hiding the versionchanged
itself. In the specific case of your example, the part you highlight can probably just be removed entirely for 3.11+, since as a following versionchanged mentions, it is no longer supported in Python 3.11.
I wrote a little Sphinx plugin years ago for Pallets/Flask for this exact case where we had years of changes that were interesting but noisy. The plugin ensures the change entries are sorted most recent first, then collapses everything but the previous version. https://pypi.org/project/sphinxcontrib-log-cabinet/ If you think that's useful, I wouldn't mind maintaining it if anything is needed.
A large number of
.. versionadded
, and.. versionchanged
directive are from long-unmaintained version of Python, from a rough search through the codebase/docs (excluding whatsnew), of everything 3.5 and before:I think that at some point it might be useful to remove those, and write the documentation as if what was changed/added has always be present.
Is there any policy as to when those can/should be removed/rephrased ?
Linked PRs