Deprecate PILLOW_VERSION and VERSION#3090
Conversation
src/PIL/__init__.py
Outdated
|
|
||
| # PILLOW_VERSION and VERSION are deprecated and will be removed in Pillow 6.0.0. Use __version__ instead. | ||
| VERSION = '1.1.7' # PIL Version | ||
| PILLOW_VERSION = version.__version__ |
There was a problem hiding this comment.
Could you rebase on the current master to see the full picture?
8f965ac to
66b6db5
Compare
src/PIL/ImageCms.py
Outdated
| return ( | ||
| VERSION, core.littlecms_version, | ||
| sys.version.split()[0], Image.VERSION | ||
| sys.version.split()[0], Image.__version__ |
docs/releasenotes/5.2.0.rst
Outdated
| Deprecations | ||
| ^^^^^^^^^^^^ | ||
|
|
||
| Two version constants – ``VERSION`` (the old PIL version 1.1.7) and |
|
You know, there's one other thing. When we ask for a version number, we should be able to ask for one thing. And unfortunately, that's going to be PILLOW_VERSION for a good long time. Otherwise, we're going to get this conversation:
|
|
That conversation is probably OK because that’s what deprecation is for. PILLOW_VERSION was a hack we should probably fix… |
docs/releasenotes/5.2.0.rst
Outdated
| * ``PIL.Image.VERSION`` | ||
| * ``PIL.Image.PILLOW_VERSION`` | ||
|
|
||
| Use ``__version__`` instead. |
|
You know, I'm for the depreciating VERSION and leaving PILLOW_VERSION as is. I don't think this is so terrible to have a fallback for code which works from the beginning of the library. This way, we are reducing the number of "version" constants from four to two in next release. |
|
@hugovk Needs rebase |
|
Thanks, will rebase. And how about we keep both deprecations in place, with VERSION to be removed in the next major version, but just say PILLOW_VERSION will be removed in a future version? That means we most importantly get rid of the confusing, different version numbers (1.1.7 vs. 5.1.0) and also discourages against PILLOW_VERSION for a bit longer. |
|
@hugovk Sounds good… I think saying we're going to get rid of |
c8c6e4b to
3daabaa
Compare
|
Rebased and updated. |
docs/releasenotes/5.2.0.rst
Outdated
| ^^^^^^^^^^^^ | ||
|
|
||
| These version constants have been deprecated. ``VERSION`` will be removed in | ||
| Pillow 6.0.0, and ``PILLOW_VERSION`` will be removed in a future release. |
There was a problem hiding this comment.
Doesn't it mean that PILLOW_VERSION will be removed in a future release i.e. in 5.3, before 6.0? For me, "and PILLOW_VERSION will be removed after that." looks more clear.
There was a problem hiding this comment.
It is ambiguous. Updated!
Edit: and rebased.
baca69c to
de6baf6
Compare
|
I was using |
|
PIL doesn't have |
PIL.VERSION always reports 1.1.7, it is deprecated since version 5.2.0 (see python-pillow/Pillow#3090), and removed from version 6.0.0. The recommended way to access the version of Pillow is PIL.__version__.
Image.VERSION always reports 1.1.7, it is deprecated since version 5.2.0 (see python-pillow/Pillow#3090), and removed from version 6.0.0. The recommended way to access the version of Pillow is Image.__version__.
For #3082.
Replaces PR #3085.
Changes proposed in this pull request:
__version__rather thanPILLOW_VERSIONPILLOW_VERSIONandVERSIONas deprecated, we'll remove them in the next major version.PILLOW_VERSION, use__version__instead.#3083 (comment):
Check
Check