-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Deprecate PILLOW_VERSION and VERSION #3090
Conversation
src/PIL/__init__.py
Outdated
@@ -13,6 +13,7 @@ | |||
|
|||
from . import version | |||
|
|||
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rebase on the current master to see the full picture?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased!
8f965ac
to
66b6db5
Compare
src/PIL/ImageCms.py
Outdated
@@ -951,5 +951,5 @@ def versions(): | |||
|
|||
return ( | |||
VERSION, core.littlecms_version, | |||
sys.version.split()[0], Image.VERSION | |||
sys.version.split()[0], Image.__version__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It used to be 1.1.7 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, reverted.
docs/releasenotes/5.2.0.rst
Outdated
Deprecations | ||
^^^^^^^^^^^^ | ||
|
||
Two version constants – ``VERSION`` (the old PIL version 1.1.7) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PIL.VERSION
and so on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PIL.__version__
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, updated.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_VERSION
PILLOW_VERSION
andVERSION
as deprecated, we'll remove them in the next major version.PILLOW_VERSION
, use__version__
instead.#3083 (comment):
Check
Check