Skip to content

Commit

Permalink
Merge pull request #4767 from hugovk/sphinx_removed_in
Browse files Browse the repository at this point in the history
Use sphinx_removed_in and re-document deprecated versions of removals
  • Loading branch information
radarhere committed Jul 9, 2020
2 parents 4aeb370 + 7c03590 commit f2c4be7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Docs
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version == 3.8
run: |
pip install sphinx-rtd-theme
pip install sphinx-removed-in sphinx-rtd-theme
make doccheck
- name: After success
Expand Down
7 changes: 6 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.intersphinx"]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_removed_in",
]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand Down
24 changes: 16 additions & 8 deletions docs/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,17 @@ period of deprecation has passed.
Python 2.7
~~~~~~~~~~

*Removed in version 7.0.0.*
.. deprecated:: 6.0.0
.. versionremoved:: 7.0.0

Python 2.7 reached end-of-life on 2020-01-01. Pillow 6.x was the last series to
support Python 2.

Image.__del__
~~~~~~~~~~~~~

*Removed in version 7.0.0.*
.. deprecated:: 6.1.0
.. versionremoved:: 7.0.0

Implicitly closing the image's underlying file in ``Image.__del__`` has been removed.
Use a context manager or call ``Image.close()`` instead to close the file in a
Expand All @@ -109,7 +111,8 @@ Use instead:
PIL.*ImagePlugin.__version__ attributes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Removed in version 7.0.0.*
.. deprecated:: 6.0.0
.. versionremoved:: 7.0.0

The version constants of individual plugins have been removed. Use ``PIL.__version__``
instead.
Expand All @@ -134,7 +137,8 @@ Removed Removed Removed
PyQt4 and PySide
~~~~~~~~~~~~~~~~

*Removed in version 7.0.0.*
.. deprecated:: 6.0.0
.. versionremoved:: 7.0.0

Qt 4 reached end-of-life on 2015-12-19. Its Python bindings are also EOL: PyQt4 since
2018-08-31 and PySide since 2015-10-14.
Expand All @@ -145,23 +149,26 @@ or PySide2.
Setting the size of TIFF images
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Removed in version 7.0.0.*
.. deprecated:: 5.3.0
.. versionremoved:: 7.0.0

Setting the size of a TIFF image directly (eg. ``im.size = (256, 256)``) throws
an error. Use ``Image.resize`` instead.

VERSION constant
~~~~~~~~~~~~~~~~

*Removed in version 6.0.0.*
.. deprecated:: 5.2.0
.. versionremoved:: 6.0.0

``VERSION`` (the old PIL version, always 1.1.7) has been removed. Use
``__version__`` instead.

Undocumented ImageOps functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Removed in version 6.0.0.*
.. deprecated:: 4.3.0
.. versionremoved:: 6.0.0

Several undocumented functions in ``ImageOps`` have been removed. Use the equivalents
in ``ImageFilter`` instead:
Expand All @@ -179,7 +186,8 @@ Removed Use instead
PIL.OleFileIO
~~~~~~~~~~~~~

*Removed in version 6.0.0.*
.. deprecated:: 4.0.0
.. versionremoved:: 6.0.0

PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour of
the upstream olefile Python package, and replaced with an ``ImportError`` in 5.0.0
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ pyroma
pytest
pytest-cov
sphinx>=2.4
sphinx-removed-in
sphinx-rtd-theme

0 comments on commit f2c4be7

Please sign in to comment.